how to use wakup interval and deep sleep
Posted: 03 Oct 2016 20:22
hallo want to make a battery driven DHT22 Multisensor.
The problem is, i could not save the wakup interval and when the z-uno is in deep sleep it never wakes up.
has some one an example?
The problem is, i could not save the wakup interval and when the z-uno is in deep sleep it never wakes up.
has some one an example?
Code: Select all
#include "ZUNO_DHT.h"
DHT dht22_sensor(11, DHT22);
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE,
SENSOR_MULTILEVEL_SCALE_CELSIUS,
SENSOR_MULTILEVEL_SIZE_TWO_BYTES,
SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS,
getter_temperature),
ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_RELATIVE_HUMIDITY,
SENSOR_MULTILEVEL_SCALE_PERCENTAGE_VALUE,
SENSOR_MULTILEVEL_SIZE_TWO_BYTES,
SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS,
getter_humidity));
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_SLEEPING);
void setup() {
dht22_sensor.begin();
}
void loop() {
zunoSendDeviceToSleep();
}
word getter_humidity() {
dht22_sensor.read(true);
float luftfeuchtigkeit = dht22_sensor.readHumidity() * 100;
zunoSendReport(2);
return luftfeuchtigkeit;
}
word getter_temperature() {
dht22_sensor.read(true);
float temperatur = dht22_sensor.readTemperature() * 100;
zunoSendReport(1);
return temperatur;
}