Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sunbox
- v. 0.2
- 25.05.2015
- Mads Havshøj
- */
- // Pin 13 has an LED connected on most Arduino boards.
- // give it a name:
- int flash = 12;
- int memOn = 4;
- int mem = 3;
- // the setup routine runs once when you press reset:
- void setup() {
- // initialize the digital pins
- pinMode(flash, OUTPUT);
- //digitalWrite(flash, LOW);
- pinMode(mem, OUTPUT);
- pinMode(memOn, INPUT);
- }
- // the loop routine runs over and over again forever:
- void loop() {
- if(digitalRead(memOn) == LOW){ //has the box been open before, be reading the mem relay?
- //delay(100); //delay, so the lid is out off the way and the player have some time to aim with the box
- digitalWrite(flash, HIGH); // turn the flash on
- delay(800); //Flash time
- digitalWrite(flash, LOW); // turn the flash off
- digitalWrite(mem, HIGH); //put the mem relay high
- }
- while(true){} // box is used - ulimited loop
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement