print timestamp / disable wifi after use
This commit is contained in:
parent
36575884f3
commit
987c98ccbe
1 changed files with 8 additions and 2 deletions
|
@ -32,7 +32,7 @@ int main() {
|
|||
|
||||
WS2812 led(WS2812_PIN);
|
||||
|
||||
wifi_setup();
|
||||
wifi_enable(); // Enable Wifi in order to set time and retrieve data
|
||||
|
||||
NtpClient::setDateTime();
|
||||
HttpClient client;
|
||||
|
@ -58,12 +58,16 @@ int main() {
|
|||
return 1;
|
||||
}
|
||||
|
||||
NtpClient::stop();
|
||||
wifi_disable(); // We don't need Wifi anymore
|
||||
|
||||
datetime_t dt;
|
||||
|
||||
auto dates = parseCsv(csv);
|
||||
#ifdef DEBUG
|
||||
printf("Number of Dates: %d\n", dates.size());
|
||||
#endif
|
||||
|
||||
while (true) {
|
||||
auto timestamp = time_us_64() + 60000000ull;
|
||||
|
||||
|
@ -80,8 +84,10 @@ int main() {
|
|||
if (isDST(dt.day, dt.month, dt.dotw))
|
||||
++hour; // MESZ
|
||||
|
||||
printf("%d-%02d-%02d %02d:%02d.%02d\n", dt.year, dt.month, dt.day, hour, dt.min, dt.sec);
|
||||
|
||||
// If there was a waste bin pickup found AND we are in the evening (>= 18:00) …
|
||||
if (it != dates.end() && hour >= 14) {
|
||||
if (it != dates.end() && hour >= 9) {
|
||||
auto wasteDate = *it;
|
||||
size_t count{0};
|
||||
auto currentTime = time_us_64();
|
||||
|
|
Loading…
Reference in a new issue