Back to Step by Step Course by Robojax
If you don't like to see ads while video is being played you can purchase YouTube premium Here
Please select other codes for this lecture from the links below.
In this lesson we learn how what an array is and how to define it. Please watch full details video. list of tipcs listed below.
Comparing two codes.
int led[] ={2, 3, 4, 5};// define LED pins in array
void setup() {
for(int i=0; i<4; i++)
{
pinMode(led[i], OUTPUT);// Define a pin as output
}
Serial.begin(9600);// initialize serial monitor
}
void loop() {
for(int i=0; i<4; i++)
{
digitalWrite(led[i],LOW); // turn all LEDs OFF
}
delay(1000);// wait for 1 secdond
for(int i=0; i<4; i++)
{
digitalWrite(led[i],HIGH); // turn LED ON
delay(1000);// wait for 1 secdond
}
}
The least I expect from you is to thumb up the video and subscribe to my channel. I appriciate that. .I have spent months making these lectures and writing code. You don't lose anything by subscribging to my channel. Your subscription is stamp of approval to my videos and more people can find them and in it turn it helps me. Thank you
If you found this tutorial helpful, please support me so I can continue creating content like this. support me via PayPal
**** AFFILIATE PROGRAM **** We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.