2019-09-25 04:24:24 +00:00
|
|
|
#include "effect_analogclock.h"
|
|
|
|
#include "my_fastled.h"
|
|
|
|
#include "ntp.h"
|
|
|
|
|
2019-10-01 04:29:32 +00:00
|
|
|
void AnalogClockEffect::loop(uint16_t ms) {
|
2019-09-25 04:24:24 +00:00
|
|
|
window->clear();
|
|
|
|
CRGB white(0xFFFFFF);
|
|
|
|
CRGB red(0xFF0000);
|
|
|
|
window->circle(8, 8, 7, &white);
|
|
|
|
|
|
|
|
uint8_t seconds = ntpClient.getSeconds();
|
|
|
|
uint8_t angle = 6 * seconds;
|
|
|
|
window->lineWithAngle(8, 8, angle, 0, 10, &red);
|
|
|
|
/*for (uint8_t i=0; i<=12; i++) {
|
|
|
|
window->lineWithAngle(8, 8, 255/12*i, 5, 2, &white);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t minutes = ntpClient.getMinutes();
|
|
|
|
uint8_t hours = ntpClient.getHours();
|
|
|
|
|
|
|
|
window->lineWithAngle(8, 8, 255/60*minutes, 6, &white);
|
|
|
|
window->lineWithAngle(8, 8, 255/12*(hours % 12), 4, &white);*/
|
|
|
|
}
|