Hello Friends! Welcome Back to "INNOVATIVE SCIENTIFIC INVENTIONS". Today I will show you. How to Blink Multiple LEDs with Arduino Mega.
Circuit Diagram:
Code:
//CODE
//CODE
int led1 = 11;
int led2 = 12;
int led3 = 13;
void setup() {
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
}
void loop() {
digitalWrite(led1,HIGH); //Led1 Blink = 1 second
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
delay(1000);
digitalWrite(led1,LOW);
digitalWrite(led2,HIGH); //Led2 Blink = 1 second
digitalWrite(led3,LOW);
delay(1000);
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
digitalWrite(led3,HIGH); //Led3 Blink = 1 second
delay(1000);
}
- Arduino Mega
- 3 LEDs
How to Upload Code in Arduino:
- Open Arduino IDE.
- Paste the code in Arduino IDE.
- Compile the Code.
- Upload the Code in Board.
How to Select Board:
- Open Arduino IDE
- Click on 'Tools' Option
- Click on 'Board'
- Select your Board
How to Select Port:
- Open Arduino IDE
- Click on 'Tools' Option
- Click on 'Port'
- Select your Port
How to Save Sketch in Computer:
- Open Arduino IDE
- Click on 'File' Option
- Click on 'Save' Option
- Select your Folder
How to 'Save as' Sketch:
- Open Arduino IDE
- Click on 'File' Option
- Click on 'Save as' Option
- Select your Folder
IF YOU WANT TO DONATE FOR "INNOVATIVE SCIENTIFIC INVENTIONS" SO PLEASE CONTACT ME.
0 Comments