From 0fb59ba5d46a74ffba35ed0c4b559fbc9c58cd55 Mon Sep 17 00:00:00 2001 From: tess Date: Sun, 9 Apr 2023 03:47:21 +0200 Subject: [PATCH] it beeps at u now plus u can pause it --- pomodoro_timer.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pomodoro_timer.ino b/pomodoro_timer.ino index e3b6154..c78720f 100644 --- a/pomodoro_timer.ino +++ b/pomodoro_timer.ino @@ -2,7 +2,7 @@ #include #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++;