Sleeping Mode
-
- Posts: 11
- Joined: 27 Jan 2018 19:48
Sleeping Mode
I'm confused on how sleeping mode works, more specifically waking the device. If I have a MQ2 smoke sensor and a DHT11 temperature sensor, what is the best way to send that info. Right now I have the device on ZUNO_SLEEPING_MODE_SLEEPING, I send the device to sleep at the end of the loop. However when I activate smoke sensor it does not wake up the device and send that signal. Does anyone have any tips or anything that I am missing to send these signals on activation for the smoke sensor and periodically for the temperature sensor?
Re: Sleeping Mode
Z-Uno wakes up on wake up interval or on interrupt. Your sensor should wake up by interrupt
-
- Posts: 11
- Joined: 27 Jan 2018 19:48
Re: Sleeping Mode
Mine is not waking up, not on the smoke sensor, or even a door sensor which is just connecting a pin to ground. Is this a known issue at all, or am I just doing something wrong?
Re: Sleeping Mode
Please share a simplified sample code that shows that it do not work.
-
- Posts: 11
- Joined: 27 Jan 2018 19:48
Re: Sleeping Mode
Code: Select all
#define DOORPIN 2
byte doorValue;
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_SLEEPING);
ZUNO_SETUP_CHANNELS(ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor));
void setup() { pinMode(DOORPIN, INPUT_PULLUP);}
void loop() {
byte currentDoorValue;
currentDoorValue = digitalRead(DOORPIN);
if (currentDoorValue != doorValue)
{
doorValue = currentDoorValue;
zunoSendReport(1);
}
zunoSendDeviceToSleep();
}
byte getterDoor(void) {
return doorValue ? 0xff : 0;
}