add mcu_sleep routines
This commit is contained in:
parent
743245e230
commit
9a3c6adf8d
9 changed files with 71 additions and 37 deletions
|
@ -17,12 +17,10 @@
|
|||
|
||||
extern "C" {
|
||||
|
||||
|
||||
#include "arduino-process.h"
|
||||
#include "rest-engine.h"
|
||||
#include "sketch.h"
|
||||
|
||||
extern volatile uint8_t mcusleepcycle; // default 16
|
||||
|
||||
// Data wire is plugged into port 2 on the Arduino
|
||||
#define ONE_WIRE_BUS 3
|
||||
#define TEMPERATURE_PRECISION 9
|
||||
|
@ -130,7 +128,7 @@ void setup (void)
|
|||
// LOOP_INTERVAL (20 * CLOCK_SECOND)
|
||||
void loop (void)
|
||||
{
|
||||
mcusleepcycle=0; // dont sleep
|
||||
mcu_sleep_off();
|
||||
// call sensors.requestTemperatures() to issue a global temperature
|
||||
// request to all devices on the bus
|
||||
// printf("Requesting temperatures...");
|
||||
|
@ -156,5 +154,5 @@ void loop (void)
|
|||
printf("Temp: %s",htu21d_temp_s);
|
||||
printf("\t\tHum: %s\n",htu21d_hum_s);
|
||||
|
||||
mcusleepcycle=32; // sleep, wakeup every 32 cycles
|
||||
mcu_sleep_on();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue