Skip to content

Instantly share code, notes, and snippets.

@dmiddlecamp
Created October 27, 2016 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmiddlecamp/24db9746998373872b472b616135dcc4 to your computer and use it in GitHub Desktop.
Save dmiddlecamp/24db9746998373872b472b616135dcc4 to your computer and use it in GitHub Desktop.
#define UDP_BROADCAST_PORT 3444
UDP Udp;
IPAddress broadcastAddress(255,255,255,255);
uint8_t txBuffer[256];
char c;
void setup() {
Udp.setBuffer(1024);
Udp.begin(UDP_BROADCAST_PORT);
txBuffer[0] = 'H';
txBuffer[1] = 'e';
txBuffer[2] = 'l';
txBuffer[3] = 'l';
txBuffer[4] = 'o';
txBuffer[5] = NULL;
Udp.sendPacket(txBuffer, 5, broadcastAddress, UDP_BROADCAST_PORT);
}
void loop() {
unsigned int now = millis();
txBuffer[0] = c++;
txBuffer[1] = NULL;
Udp.sendPacket(txBuffer, 1, broadcastAddress, UDP_BROADCAST_PORT);
delay(10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment