Watchdog in the first Byte
This commit is contained in:
parent
0991343a55
commit
7ab1ee525d
7
UDP.ino
7
UDP.ino
|
@ -7,6 +7,8 @@ const char* password = "&nHM%D2!$]Qg[VUv";
|
||||||
const IPAddress multicastIP = IPAddress(239, 1, 2, 3);
|
const IPAddress multicastIP = IPAddress(239, 1, 2, 3);
|
||||||
int port = 1234;
|
int port = 1234;
|
||||||
|
|
||||||
|
byte watchdog = 0;
|
||||||
|
|
||||||
AsyncUDP udp;
|
AsyncUDP udp;
|
||||||
|
|
||||||
void UdpInit() {
|
void UdpInit() {
|
||||||
|
@ -16,8 +18,9 @@ void UdpInit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UdpLoop() {
|
void UdpLoop() {
|
||||||
byte data[8] = {1, 2, 3, 4, 5, 6, 7, 8};
|
byte data[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||||
udp.writeTo(data, sizeof(data), multicastIP, port);
|
data[0] = watchdog++;
|
||||||
|
udp.writeTo(data, sizeof(data), multicastIP, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue