debug
This commit is contained in:
parent
7e0e06f335
commit
978cf36e1e
2 changed files with 22 additions and 2 deletions
21
src/main.cpp
21
src/main.cpp
|
|
@ -346,6 +346,27 @@ void loop()
|
|||
iseDisplay.updateDateTimeText(time);
|
||||
last_time_updated = millis();
|
||||
}
|
||||
|
||||
// Send out analog Data every 6 seconds
|
||||
static uint32_t last_analog_sent = 0;
|
||||
if (millis() - last_analog_sent > 6000)
|
||||
{
|
||||
espmega.iot->publish("/debug/up", "1");
|
||||
if (analogCardAvailable || CT_FORCE_ENABLE)
|
||||
{
|
||||
espmega.iot->publish("/debug/log", "Sending Analog Card Data");
|
||||
char topic_buffer[50];
|
||||
char payload_buffer[50];
|
||||
// Publish ADC Pin 0-7
|
||||
for (uint8_t i = 0; i < 8; i++)
|
||||
{
|
||||
sprintf(topic_buffer, "/debug/analog/%d", i);
|
||||
sprintf(payload_buffer, "%d", analogCard.analogRead(i));
|
||||
espmega.iot->publish(topic_buffer, payload_buffer);
|
||||
}
|
||||
}
|
||||
last_analog_sent = millis();
|
||||
}
|
||||
}
|
||||
|
||||
void on_pin_change(uint8_t pin, uint8_t value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue