Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup()
- {
- pinMode(13,OUTPUT);
- pinMode(12,INPUT);
- }
- void loop()
- {
- if (digitalRead(12) == HIGH) // this will activate ONLY IF pin 12 is HIGH
- {
- digitalWrite(13,HIGH);
- delay(map(analogRead(A0),0,1023,0,600000)); // delayed based off POT value
- digitalWrite(13,LOW);
- delay(map(analogRead(A0),0,1023,0,600000)); // same as above, except delayed in the off position - this will give time to turn phone or alarm off!
- }// will loop back to top of if statement and will not start again until pin 12 is high
- else
- {
- digitalWrite(13,LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement