Wednesday, September 30, 2009

Original Code

This is the original code I used, written by DojoDave. The switch task was to focus on making a switch so I guess I didn't need to write anything else.

/*
created 2005
by DojoDave
modified 17 Jun 2009
by Tom Igoe
http://www.arduino.cc/en/Tutorial/Button
*/


const int buttonPin = 2;
const int ledPin = 13;

void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}

void loop(){
buttonState = digitalRead(buttonPin);

if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
}

1 comment:

  1. How did you make this code your own? Where are the comments? The video??

    ReplyDelete