Hi Everyone,
I am new to arduino and to programming in general. I want to connect a series of Leds (8) to my arduino board and make them all blink at random. Here is my very first piece of code XD. I was wondering wether I was going the right way (sorry it's probably very basic).
void setup() {
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
}
void loop() {
digitalWrite(1, HIGH);
delay(3000);
digitalWrite(1, LOW);
delay(3000);
digitalWrite(2, HIGH);
delay(4000);
digitalWrite(2, LOW);
delay(4000);
digitalWrite(3, HIGH);
delay(3500);
digitalWrite(3, LOW);
delay(3500);
digitalWrite(4, HIGH);
delay(1200);
digitalWrite(4, LOW);
delay(1200);
digitalWrite(5, HIGH);
delay(2000);
digitalWrite(5, LOW);
delay(2000);
digitalWrite(6, HIGH);
delay(2000);
digitalWrite(6, LOW);
delay(2000);
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
delay(1000);
digitalWrite(8, HIGH);
delay(3000);
digitalWrite(8, LOW);
delay(3000);
}