summaryrefslogtreecommitdiff
path: root/user-code/push/arduino-old/led-push-button/led-push-button.ino
blob: 1cfa5e20108e862eeb1b4a706de27c9709f3b312 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const int sensorPin = 12;    
const int ledPin = 9;      
int sensorValue;  
int i;
void setup() {  
  pinMode(9, OUTPUT);
  pinMode(12, INPUT);
  for (i = 0; i < 1000; i++) {
    sensorValue = digitalRead(12);
    if (sensorValue==0) {
      digitalWrite(9, LOW);
      delay(5);
    } 
    else { 
     digitalWrite(9, HIGH);
     delay(5);
    } 
  }
}
void loop() {
}