HELLO THERE!!!
How are you guys? I hope everyone is fine and in a good mood always. First of all, I would like to ask for forgiveness because I had suddenly stopped tinkering for about a month. This is due to me landing my first job (YeaYYY!!). So, I am currently in process of rearranging my schedule to fit my time. After this, I would try to post my tinkerings on every weekends.
So, this week, I would like to share with you guys a simple experiment on arduino and multi function shield. I will be showing you guys on how to blink all the LEDs in the multi function shield. Without further wasting time, let's get straight to experiment!!!
HARDWARE:
1. Arduino UNO
How are you guys? I hope everyone is fine and in a good mood always. First of all, I would like to ask for forgiveness because I had suddenly stopped tinkering for about a month. This is due to me landing my first job (YeaYYY!!). So, I am currently in process of rearranging my schedule to fit my time. After this, I would try to post my tinkerings on every weekends.
So, this week, I would like to share with you guys a simple experiment on arduino and multi function shield. I will be showing you guys on how to blink all the LEDs in the multi function shield. Without further wasting time, let's get straight to experiment!!!
HARDWARE:
1. Arduino UNO
2.Multi-Function Shield
SOFTWARE
1. Arduino IDE
CIRCUIT ASSEMBLY
The circuit assembly is fairly simple. Just attach the multi function shield on top of Arduino properly. Please attach the shield properly as failure to do so would cause the shield not to function as intended.
CODING THE ARDUINO:
Let's refer to the image below:
From the image, you can see that LEDs D1,D2,D3 and D4 are connected to pin 13,pin 12, pin 11, and pin 10. Thus, our code will be as follows:
//initializing the 4 LEDs
int l1 = 13;
int l2 = 12;
int l3 = 11;
int l4 = 10;
//Setting the mode of the LEDs
void setup() {
pinMode (l1,OUTPUT);
pinMode (l2,OUTPUT);
pinMode (l3,OUTPUT);
pinMode (l4,OUTPUT);
}
void loop() {
digitalWrite (l1,HIGH); //light up the LEDs
digitalWrite (l2,HIGH);
digitalWrite (l3,HIGH);
digitalWrite (l4,HIGH);
delay(1000); //give 1 second delay
digitalWrite (l1,LOW);//turn of the LEDs
digitalWrite (l2,LOW);
digitalWrite (l3,LOW);
digitalWrite (l4,LOW);
delay (1000);
}
Upload the code to your Arduino and let the LEDs BLINK!!!!. If everything goes alright, the 4 LEDs in the multifunction shield should blinks as shown in the video:
Well, that's all from me guys. I hope to see you guys in my next blog post ( hopefully this weekend). Till then, HAPPY TINKERING!!!
Comments
Post a Comment