Advertisement
Cookins

Untitled

Mar 19th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. int val = 0;//sets value variable to 0
  2.  
  3. void setup() {
  4. pinMode (13,OUTPUT);//pin 13 is the led pin and speaker
  5. pinMode (9, INPUT);//pin 9 reads the high signal from the PIR
  6. }
  7. void loop () {
  8. val = digitalRead(9);//Pin 9 is initiallly 0
  9. digitalWrite(13,val);//pin thirteen is equal to whatever pin 9 is
  10. delay(100);
  11. digitalWrite(13,LOW);//led turns off
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement