Setting time with buttons
opened this issue · comments
Hi!
I love the project but I'm not very familiar with c++.
Looking through the code there is no obvious way to set the time without WIFI.
Could you please describe a way I could use the buttons to set the time rather than needing to be attached to WIFI?
Regards,
Ollie
Hey Ollie,
Thank!
I use the ESP32 internal system time, which is set via NTP, to track the time. You can set is manually if you want with settimeofday() or use a library like this one.
Here is where the time is set and written to the display if you want to have a go at it.
I might be able to implement something over the weekend to set the time with the buttons.
Thankyou that would be interesting to see! i dont know C++ yet so i wouldn't even know to start. but i basically started to write the software again in python as a learning exercise.
I saw there were some python files in the code folder but it was just an empty file. any reason for this? or was it ssomething you were going to work on?
I added a bit of code to set the time with the buttons once the wifi connection fails for a few seconds. Left/Right -> up/down; middle -> set the minutes/finish.
I created the python folder for playing around with MicroPython, but never pushed the code due to some bug with mapping I2C to the pins I had chosen.
Okay nice, I'll have a look. I actually got it working with micropython today but the i2c does seem a little slow to update I'm not sure why but it might be the library I'm using.