Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int LDR = A0;
- const int PIR = 1;
- const int relay = 13;
- const int button_ON = 10;
- const int mom_switch = 9;
- const int blu_LED = 8;
- const int ora_LED = 7;
- void setup() {
- pinMode(LDR, INPUT);
- pinMode(PIR, INPUT);
- pinMode(relay, OUTPUT);
- pinMode(button_ON, INPUT); //Button Push
- pinMode(mom_switch, INPUT); //Button Momentary
- pinMode(blu_LED, OUTPUT);//LED Blue
- pinMode(ora_LED, OUTPUT);//LED Orange
- }
- void loop() {
- while (digitalRead(button_ON) == HIGH) {
- digitalWrite(blu_LED, HIGH);
- digitalWrite(relay, HIGH);
- }
- if (digitalRead(mom_switch) == HIGH) {
- digitalWrite(ora_LED, HIGH);
- digitalWrite(relay, HIGH);
- delay(900000);
- digitalWrite(ora_LED, LOW);
- digitalWrite(relay, LOW);}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement