Advertisement
icstation

the code for Anti-theft alarm system based on Arduino

Dec 8th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. void setup()
  2. {
  3. pinMode( 8 , OUTPUT);
  4. Serial.begin(9600);
  5. pinMode( 9 , OUTPUT);
  6. }
  7.  
  8. void loop()
  9. {
  10. Serial.print( analogRead(A0) );
  11. Serial.println("");
  12. digitalWrite( 8 , HIGH );
  13. delay( 50 );
  14. digitalWrite( 8 , LOW );
  15. delay( 50 );
  16. digitalWrite( 9 , HIGH );
  17. if (( ( analogRead(A0) ) == ( 1023 ) ))
  18. {
  19. digitalWrite( 9 , LOW );
  20. delay( 10000 );
  21. }
  22. }
  23.  
  24.  
  25. http://www.instructables.com/id/Anti-theft-Entrance-Guard-Alarm-System-Based-on-Ar/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement