rstephan / ArtnetWifi

Arduino library for Art-Net (artnet) over WiFi, send and receive DMX data. Runs on ESP8266, ESP32, Pi Pico W, WiFi101 and WiFiNINA devices.
Other
368 stars 63 forks source link

LED state on receiving and not receiving #43

Closed erasmudj closed 2 years ago

erasmudj commented 2 years ago

Is it possible to set set a LED for when a packet is received (Green LED) and when no packet received (Red LED)?

erasmudj commented 2 years ago

I managed to solve it running this code every 1000ms using mills not delay.

if (currentMillis - previousMillis >= interval) { // save the last time you check communication previousMillis = currentMillis; bool artnetoff = artnet.read(); if (!artnetoff) { artnetoffcount++; } else { artnetoffcount = 0; } } if (artnetoffcount > 4) { // must be off for 5 minutes // set led or what ever to show artnet is down } else { // set led or what ever to show artnet if working }