WordClockESP/src/Clock.h

37 lines
645 B
C
Raw Normal View History

2021-03-06 22:06:09 +01:00
//
// Created by lukas on 06.03.21.
//
#ifndef LEDSTRIPINTERFACE_CLOCK_H
#define LEDSTRIPINTERFACE_CLOCK_H
#include <Ticker.h>
#include "Adafruit_NeoPixel.h"
#include "Arduino.h"
#include "LoadAnimator.h"
2021-03-06 22:06:09 +01:00
#define NUMPIXELS 108 // Popular NeoPixel ring size
class Clock {
private:
Adafruit_NeoPixel strip{};
LoadAnimator animator;
2021-03-06 22:06:09 +01:00
void paintAllwaysOnLeds();
void printWord(const std::vector<uint8_t>& word, uint32_t color);
2021-03-06 22:06:09 +01:00
void setTime(uint8_t hour, uint8_t minute);
void refreshTime();
2021-03-06 22:06:09 +01:00
public:
Clock();
void init();
void turnOff();
void turnOn();
2021-03-06 22:06:09 +01:00
Ticker refreshTicker;
};
#endif // LEDSTRIPINTERFACE_CLOCK_H