sqfmi / Watchy

Watchy - An Open Source E-Ink Smartwatch
http://www.sqfmi.com
MIT License
1.85k stars 322 forks source link

Vibrate every hour on the dot #189

Closed shtrom closed 1 year ago

shtrom commented 1 year ago

Add opion to vibrate every hour (and on reset)

Set watchySettings.vibrateOClock to true to activate.

shtrom commented 1 year ago

I wasn't sure how often the RTC ticked. I guess every minutes, but maybe more often? So the alreadyVibrated variable ensures we only vibrate once per hour, at currentTime.Minute == 0 , regardless of how often the RTC wakes us up in that minute.

It gets reset to false any time it's not 0 minutes, ready for the next hour.

sqfmi commented 1 year ago

The RTC should tick once per minute by default, so I think the currentTime.Minute == 0 condition should trigger the vibrate once per hour, without needing alreadyVibrated (since subsequent in subsequent ticks currentTime.Minute won't be 0)

shtrom commented 1 year ago

This should be good now 👍🏼

sqfmi commented 1 year ago

Looks great, thanks!