dumped all my old arduino stuff in here.
This commit is contained in:
parent
8cc6f23f59
commit
8f8959b76f
76 changed files with 8127 additions and 2 deletions
29
Motion_Sensor/Motion_Sensor.pde
Normal file
29
Motion_Sensor/Motion_Sensor.pde
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
|
||||
|
||||
int buttonState = 0;
|
||||
|
||||
void setup() {
|
||||
|
||||
Serial.begin(9600);
|
||||
|
||||
|
||||
pinMode(7, INPUT);
|
||||
pinMode(13, OUTPUT);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
|
||||
|
||||
buttonState = digitalRead(7);
|
||||
|
||||
if (buttonState == HIGH) {
|
||||
digitalWrite(13, HIGH);
|
||||
}
|
||||
else {
|
||||
digitalWrite(13, LOW);
|
||||
}
|
||||
Serial.println(buttonState, DEC);
|
||||
delay(1000); // wait for a second
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue