Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int val = 0;//sets value variable to 0
- void setup() {
- pinMode (13,OUTPUT);//pin 13 is the led pin and speaker
- pinMode (9, INPUT);//pin 9 reads the high signal from the PIR
- }
- void loop () {
- val = digitalRead(9);//Pin 9 is initiallly 0
- digitalWrite(13,val);//pin thirteen is equal to whatever pin 9 is
- delay(100);
- digitalWrite(13,LOW);//led turns off
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement