sources and files for the bombatuino project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
505 B

11 years ago
  1. const int buttonPin = 2; // the number of the pushbutton pin
  2. const int ledPin = 13; // the number of the LED pin
  3. void setup() {
  4. // initialize the LED pin as an output:
  5. pinMode(ledPin, OUTPUT);
  6. // initialize the pushbutton pin as an input:
  7. pinMode(buttonPin, INPUT);
  8. digitalWrite(buttonPin, HIGH);
  9. }
  10. void loop(){
  11. int buttonState = digitalRead(buttonPin);
  12. if (buttonState == LOW) {
  13. digitalWrite(ledPin, HIGH);
  14. }
  15. else {
  16. digitalWrite(ledPin, LOW);
  17. }
  18. }