it beeps at u now plus u can pause it
This commit is contained in:
parent
204cb73818
commit
0fb59ba5d4
|
@ -2,7 +2,7 @@
|
||||||
#include <Adafruit_Circuit_Playground.h>
|
#include <Adafruit_Circuit_Playground.h>
|
||||||
|
|
||||||
#define BREAK_TIME 5
|
#define BREAK_TIME 5
|
||||||
#define WORK_TIME 1
|
#define WORK_TIME 25
|
||||||
#define NUM_PIXELS 10
|
#define NUM_PIXELS 10
|
||||||
boolean work = false;
|
boolean work = false;
|
||||||
|
|
||||||
|
@ -19,11 +19,15 @@ void loop() {
|
||||||
counter++;
|
counter++;
|
||||||
if (counter % 6000 == 0) {
|
if (counter % 6000 == 0) {
|
||||||
alert();
|
alert();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
work = !work;
|
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
|
// Turn ON all the NeoPixels
|
||||||
if (work) {
|
if (work) {
|
||||||
lights(0, 255, 255, 0);
|
lights(0, 255, 255, 0);
|
||||||
|
@ -54,7 +58,7 @@ void loop() {
|
||||||
delay(200); //bc otherwise it gets triggered multiple times
|
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);
|
CircuitPlayground.setPixelColor(t, 0, 0, 0);
|
||||||
timer_counter = 0;
|
timer_counter = 0;
|
||||||
t++;
|
t++;
|
||||||
|
|
Loading…
Reference in New Issue