forgot to commit everything...

This commit is contained in:
2018-02-03 16:55:37 +01:00
parent 20d46af1fb
commit 3da4722748
15 changed files with 991 additions and 0 deletions

45
user/Rainbow.h Normal file
View File

@@ -0,0 +1,45 @@
#ifndef RAINBOW_H
#define RAINBOW_H
#include "ESP8266lib/ext/led/WS2812B.h"
/**
* show rainbow colors using HUE
*/
class Rainbow {
uint8_t hue = 0;
public:
/** ctor */
Rainbow() {
;
}
/** show a beat by shifting the hue color */
void shift(const int val) {
hue += val;
}
/** set hue back to 0 */
void restart() {
hue = 0;
}
/** called from the main */
void update() {
++hue;
}
/** called from the main */
Color getCurrent() const {
Color c; c.setHSV(hue, 255, 255);
return c;
}
};
#endif // RAINBOW_H