Loading...
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 422 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

Netherlands
Offline Offline
Tesla Member
***
Karma: 90
Posts: 9429
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 -

Santa Fe
Offline Offline
Full Member
***
Karma: 1
Posts: 192
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: 138
Posts: 19067
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.

Pages: [1]   Go Up
Print
 
Jump to: