- Lesson 57-1: Reading i and array
- Lesson 57-2: turning 4 LEDs ON and OFF using array
- Lesson 57-3: Reading and printing array values
- Lesson 57-4: 4 LED ON and OFF wihtout Array
- Lesson 57-5: Reading age and marks using Array
- Lesson 57-6: Controlling 4 LEDs with loop
- Lesson 57-7: Controling 4 LEDs with different timing
Lesson 57: Using Array and Loop with Arduino
Lesson 57: Using Array and Loop with Arduino
Please select other codes for this lecture from the links below.
Part 6: Arduino Practiall Programming
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.
- 00:00 what is array?
- 02:52 Reading Array values
- 04:41 Updating array values
- 06:44 Defining empty array : integer
- 08:31 Defining empty array: float
- 10:58 Working with loops
- 15:30 Reading values of array
- 16:51 Demo: Reading values
- 17:34 filling up an array with float data type
- 18;48 reading and printing each element of array
- 19:55 Project: 4 LEDs with array
- 21:22 Project: wiring
- 23:26 demo: 4 LEDs
- 23:46 demo 2: 4 LEDs
- 24:05 code: 2
- 24:51 Comparing two codes (code in this page)
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
}
}