Add the button to the relay sketch
This commit is contained in:
parent
4aceeac1c2
commit
bbf0cbd1c6
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
//CAMERA CONSTANTS
|
//CAMERA CONSTANTS
|
||||||
const int CAMERA = 2;
|
const int CAMERA = 2;
|
||||||
|
const int BUTTON = 7;
|
||||||
const int LED = 8;
|
const int LED = 8;
|
||||||
|
|
||||||
const int CAMERA_MOMENT = 240;
|
const int CAMERA_MOMENT = 240;
|
||||||
|
@ -45,11 +46,15 @@ void loop () {
|
||||||
now = millis();
|
now = millis();
|
||||||
cmdChar = mc.loop();
|
cmdChar = mc.loop();
|
||||||
cmd(cmdChar);
|
cmd(cmdChar);
|
||||||
|
if (digitalRead(BUTTON) == LOW) {
|
||||||
|
camera();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pins () {
|
void pins () {
|
||||||
pinMode(CAMERA, OUTPUT);
|
pinMode(CAMERA, OUTPUT);
|
||||||
pinMode(LED, OUTPUT);
|
pinMode(LED, OUTPUT);
|
||||||
|
pinMode(BUTTON, INPUT_PULLUP);
|
||||||
|
|
||||||
digitalWrite(CAMERA, HIGH);
|
digitalWrite(CAMERA, HIGH);
|
||||||
digitalWrite(LED, LOW);
|
digitalWrite(LED, LOW);
|
||||||
|
|
Loading…
Reference in New Issue