added option to buzz on prime, with settings

master
Hugh Barney 2022-11-05 15:52:38 +00:00
parent 409cba80b9
commit 453895c134
2 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,12 @@ A watchface that displays time and its prime factors in the Lato font.
For example when the time is 21:05, the prime factors are 5,421.
Displays 'Prime Time!' when the time is a prime number.
There is a settings option added in the Settings App. If 'Buzz on
Prime' is ticked then the buzzer will sound when 'Prime Time!' is
detected. Note the buzzer is limited to between 8am and 8pm so it
should not go off when you want to sleep.
![](screenshot.jpg)
Written by: [Hugh Barney](https://github.com/hughbarney)

View File

@ -76,6 +76,7 @@ function draw() {
g.setFontLatoSmall();
g.drawString(primeStr, w/2, 3*h/4);
// Buzz if Prime Time and between 8am and 8pm
if (settings.buzz_on_prime && primeStr == "Prime Time!" && intTime >= 800 && intTime <= 2000)
buzzer(2);