49 lines
1.0 KiB
C
49 lines
1.0 KiB
C
|
//
|
||
|
// 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 "../.pio/libdeps/node32s/Adafruit NeoPixel/Adafruit_NeoPixel.h"
|
||
|
|
||
|
#define NUMPIXELS 108 // Popular NeoPixel ring size
|
||
|
|
||
|
class Clock {
|
||
|
private:
|
||
|
Adafruit_NeoPixel strip{};
|
||
|
|
||
|
void paintAllwaysOnLeds();
|
||
|
void printWord(std::vector<int> word, uint32_t color);
|
||
|
void setTime(uint8_t hour, uint8_t minute);
|
||
|
|
||
|
public:
|
||
|
Clock();
|
||
|
void init();
|
||
|
void refreshTime();
|
||
|
|
||
|
Ticker refreshTicker;
|
||
|
};
|
||
|
struct types {
|
||
|
static const std::vector<int>
|
||
|
es, ist, fuenf,
|
||
|
zehn, zwanzig, drei,
|
||
|
viertel, dreiviertel, vor,
|
||
|
nach, halb, zwoelf,
|
||
|
sieben, ein, eins,
|
||
|
vier, acht, sechs,
|
||
|
zwei, fuenf2, elf,
|
||
|
zehn2, neun, drei2,
|
||
|
ein2, uhr;
|
||
|
|
||
|
static uint8_t convert(uint8_t x, uint8_t y);
|
||
|
|
||
|
static std::vector<int> calcPixels(uint8_t x, uint8_t y, uint8_t nrPixels);
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif // LEDSTRIPINTERFACE_CLOCK_H
|