Advertisement
Guest User

Sunbox

a guest
May 25th, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.97 KB | None | 0 0
  1. /*
  2.   Sunbox
  3.   v. 0.2
  4.   25.05.2015
  5.  
  6.   Mads Havshøj
  7.  
  8.  */
  9.  
  10. // Pin 13 has an LED connected on most Arduino boards.
  11. // give it a name:
  12. int flash = 12;
  13. int memOn = 4;
  14. int mem = 3;
  15.  
  16. // the setup routine runs once when you press reset:
  17. void setup() {                
  18.   // initialize the digital pins
  19.   pinMode(flash, OUTPUT);
  20.   //digitalWrite(flash, LOW);
  21.   pinMode(mem, OUTPUT);
  22.   pinMode(memOn, INPUT);  
  23. }
  24.  
  25. // the loop routine runs over and over again forever:
  26. void loop() {
  27.  
  28.  
  29.   if(digitalRead(memOn) == LOW){ //has the box been open before, be reading the mem relay?
  30.     //delay(100); //delay, so the lid is out off the way and the player have some time to aim with the box    
  31.     digitalWrite(flash, HIGH);   // turn the flash on
  32.     delay(800);                 //Flash time
  33.     digitalWrite(flash, LOW);    // turn the flash off
  34.     digitalWrite(mem, HIGH);   //put the mem relay high
  35.     }
  36.  
  37.   while(true){} // box is used - ulimited loop
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement