Go Down

Topic: sketch to control an led ilumination (Read 801 times) previous topic - next topic

please can you give me the code to control an ilumination of a led :)

robtillaart

#1
May 08, 2012, 10:31 pm Last Edit: May 08, 2012, 10:33 pm by robtillaart Reason: 1
starter ... connect switch to pin 10 and LED to 13 (add resistor 220 ohm)
Code: [Select]

void setup()
{
 pinMode(10, INPUT);
 pinMode(13, OUTPUT);
}

void loop()
{
 digitalWrite(13, digitalRead(10);
}
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

RPCoyle

go to examples/basic/blink in the Arduino programming environment...that's what it's there for

AWOL

Code: [Select]
digitalWrite(13, digitalRead(10);
Close...but no cigar.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

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!

Arduino
via Egeo 16
Torino, 10131
Italy