First commit

This commit is contained in:
2020-08-01 13:47:02 +03:00
commit ac18805ff4
142 changed files with 8325 additions and 0 deletions

27
VT_ESP8266/src/leds.cpp Normal file
View File

@@ -0,0 +1,27 @@
#include <leds.h>
leds::leds(PCF8574 *pcf, int pinLED, int onms, bool inverse)
{
_pcf = pcf;
ledPin = pinLED;
inv = inverse;
onMS = onms;
state = false;
}
void leds::start()
{
curMS = millis();
state = true;
_pcf->write(ledPin, !inv);
//digitalWrite(ledPin, !inv);
}
void leds::tick()
{
if(state && ((curMS + onMS) < millis())){
state = false;
_pcf->write(ledPin, inv);
//digitalWrite(ledPin, inv);
}
}