Millis to MYS lamp

This commit is contained in:
2020-11-30 16:40:16 +03:00
parent 923989d29f
commit 73615da0f1

View File

@@ -12,6 +12,7 @@
//MyMessage msgLev(1, V_DIMMER);
uint16_t lightLevel;
bool lightOn = false;
MyMessage msgMillis(0, V_VAR1);
void before()
{
@@ -26,12 +27,17 @@ void setup()
void presentation()
{
// Send the sketch version information to the gateway and Controller
sendSketchInfo("Night Light", "2.0");
sendSketchInfo("Night Light", "2.1");
present(0, S_DIMMER, "Dimmer");
}
void loop()
{
static uint32_t cRun = millis();
if((cRun + 10000) < millis()){
cRun = millis();
send(msgMillis.set(cRun));
}
}
void receive(const MyMessage &message)