Go Down

Topic: LED code (Read 2186 times) previous topic - next topic


Oct 25, 2013, 12:08 am Last Edit: Oct 25, 2013, 12:12 am by Ghostbusters Reason: 1
when writing down code to turn on multiple LEDs before i write down
Code: [Select]
(4,,5,6,7,3,8 HIGH)]
before i write that down do i write
Code: [Select]
;digitalWrite or do i write something else


digitalWrite(pin, HIGH); can only turn on one pin.  You need a separate call for each pin:
Code: [Select]

digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6 HIGH);
digitalWrite(7, HIGH);
digitalWrite(3, HIGH);
digitalWrite(8, HIGH);

The program will run so fast you won't be able to see that the first one lit a few microseconds before the last one.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


Go Up