Created
October 27, 2016 16:11
-
-
Save dmiddlecamp/24db9746998373872b472b616135dcc4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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