Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
diksha-curiosity authored Oct 28, 2024
1 parent ad670d4 commit 14cb463
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CG_Bot_Blink_two_LEDs_Analog_Write.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
void setup()
{
pinMode(A4, OUTPUT); // Set pin 4 as an output for LED1
pinMode(A5, OUTPUT); // Set pin 5 as an output for LED2
}

void loop()
{
analogWrite(A4, 255); // Set LED1 (connected to pin 4) to maximum brightness (255)
delay(1000); // Wait for 1000 milliseconds (1 second) with LED1 ON at full brightness

analogWrite(A4, 0); // Turn off LED1 by setting brightness to 0
delay(1000); // Wait for 1000 milliseconds (1 second) with LED1 OFF

analogWrite(A5, 255); // Set LED2 (connected to pin 5) to maximum brightness (255)
delay(1000); // Wait for 1000 milliseconds (1 second) with LED2 ON at full brightness

analogWrite(A5, 0); // Turn off LED2 by setting brightness to 0
delay(1000); // Wait for 1000 milliseconds (1 second) with LED2 OFF
}

0 comments on commit 14cb463

Please sign in to comment.