Poll
Question: control  led iluminatioono
sdafd - 0 (0%)
dsadsa - 3 (100%)
Total Voters: 3

Pages: [1]   Go Down
Author Topic: sketch to control an led ilumination  (Read 600 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

please can you give me the code to control an ilumination of a led smiley
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12483
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

starter ... connect switch to pin 10 and LED to 13 (add resistor 220 ohm)
Code:
void setup()
{
  pinMode(10, INPUT);
  pinMode(13, OUTPUT);
}

void loop()
{
  digitalWrite(13, digitalRead(10);
}
« Last Edit: May 08, 2012, 03:33:19 pm by robtillaart » Logged

Rob Tillaart

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

Santa Fe
Offline Offline
Full Member
***
Karma: 1
Posts: 201
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24449
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
digitalWrite(13, digitalRead(10);
Close...but no cigar.
Logged

"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.

Pages: [1]   Go Up
Jump to: