Learn a Simple Arduino Blinking LED Project Using Tinkercad
by marcosan in Circuits > Arduino
307 Views, 2 Favorites, 0 Comments
Learn a Simple Arduino Blinking LED Project Using Tinkercad
Learn a Simple Arduino blinking LED project using Tinkercad
Supplies
All you need is a computer and internet connection for this tutorial
On the home page click on new and select circuit.
now you are here on the workspace. Use the search bar to search for the components(breadboard,arduino,LED,resistor) just hold and drag it
put resistor to one side of led and connect the resistor to negative value (ground power supply value)in breadboard . Connect the other side of led to the arduino any number will work.
int led1=11;
int led2=10;
int led3=9;
int led4=8;
int led5=7;
int led6=6;
int led7=5;
int led8=4;
void setup()
{
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
}
void loop()
{
ledon1() ;
delay(1000);
ledon2();
delay(1000);
ledon3();
delay(1000);
ledon4();
delay(1000);
}
void ledon1(){
digitalWrite(led1,HIGH);
digitalWrite(led2,LOW);
digitalWrite(led3,HIGH);
digitalWrite(led4,LOW);
digitalWrite(led5,HIGH);
digitalWrite(led6,LOW);
digitalWrite(led7,HIGH);
digitalWrite(led8,LOW);
}
void ledon2(){
digitalWrite(led1,LOW);
digitalWrite(led2,HIGH);
digitalWrite(led3,LOW);
digitalWrite(led4,HIGH);
digitalWrite(led5,LOW);
digitalWrite(led6,HIGH);
digitalWrite(led7,LOW);
digitalWrite(led8,HIGH);
}
void ledon3(){
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
digitalWrite(led3,HIGH);
digitalWrite(led4,HIGH);
digitalWrite(led5,LOW);
digitalWrite(led6,LOW);
digitalWrite(led7,HIGH);
digitalWrite(led8,HIGH);
}
void ledon4(){
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
digitalWrite(led5,HIGH);
digitalWrite(led6,HIGH);
digitalWrite(led7,LOW);
digitalWrite(led8,LOW);
}
1.on coding start with initialization of variables led.
2.Next is void setup()
{
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
}
3. void loop will call the instructions of variables ledon1and 2 and will loop it with the delay of 1 sec
void loop()
{
ledon1() ;
delay(1000);
ledon2() ;
delay(1000);
}
4.void ledon1 is the instruction of what wil led do
void ledon1(){
digitalWrite(led1,HIGH);
digitalWrite(led2,LOW);
}