Go Down

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

filipeishon

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