Open jywarren opened 5 years ago
Eventually we could output over WebJack too! https://webjack.io
We should:
Notes on triggering every hour:
delay(5UL*60UL*60UL*1000UL); // Wait 5 hours
(from here)Here's a demo too:
#define TWELVE_HRS 43200000UL
unsigned long startTime;
setup()
{
startTime = millis();
}
loop()
{
if (millis() - startTime > TWELVE_HRS)
{
// Put your code that runs every 12 hours here
startTime = millis();
}
}
We should also maybe delay startup of the sensor by 5 seconds, so if it's solar powered, it doesn't turn on and off a lot when power is low (this needs breaking out as its own issue).
It could save a measurement every hour, to save space.
https://www.arduino.cc/en/Tutorial/EEPROMWrite
It could also output all the data quickly on startup (over serial) so that when it's plugged into a computer, you can press the reset button and get all the data out.
https://www.arduino.cc/en/Reference/EEPROM says: