Added sunrise suport

This commit is contained in:
IMback
2017-08-14 21:07:08 +02:00
parent d0ca835df2
commit b4d1844b68
65 changed files with 6409 additions and 24 deletions

View File

@ -1,3 +1,4 @@
#include <util/delay.h>
#include "pwm.h"
class RgbLed
@ -11,6 +12,11 @@ private:
uint16_t _counter = 0;
bool _stroke = false;
uint8_t _targetR = 0;
uint8_t _targetG = 0;
uint8_t _targetB = 0;
bool _fade = true;
uint8_t _fadeSpeed = 7;
void patternStep();
@ -24,9 +30,16 @@ public:
void on();
void off();
void setFade(bool fade = true);
void logic();
uint8_t getR();
uint8_t getB();
uint8_t getG();
};
template <typename T> T sgn(T val)
{
return (T(0) < val) - (val < T(0));
}