it beeps at u now plus u can pause it

This commit is contained in:
tess 2023-04-09 03:47:21 +02:00
parent 204cb73818
commit 0fb59ba5d4
1 changed files with 8 additions and 4 deletions

View File

@ -2,7 +2,7 @@
#include <Adafruit_Circuit_Playground.h>
#define BREAK_TIME 5
#define WORK_TIME 1
#define WORK_TIME 25
#define NUM_PIXELS 10
boolean work = false;
@ -19,11 +19,15 @@ void loop() {
counter++;
if (counter % 6000 == 0) {
alert();
}
}
work = !work;
int goal = 0;
if (work) {
goal = 6000 / NUM_PIXELS * WORK_TIME;
} else {
goal = 6000 / NUM_PIXELS * BREAK_TIME;
}
// Turn ON all the NeoPixels
if (work) {
lights(0, 255, 255, 0);
@ -54,7 +58,7 @@ void loop() {
delay(200); //bc otherwise it gets triggered multiple times
}
if ((work && timer_counter == (WORK_TIME * 6000 / NUM_PIXELS)) || (!work && timer_counter == (BREAK_TIME * 6000 / NUM_PIXELS))) {
if (timer_counter == goal) {
CircuitPlayground.setPixelColor(t, 0, 0, 0);
timer_counter = 0;
t++;