Go Down

Topic: LED code (Read 1 time) 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: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131