Created
March 22, 2017 20:45
-
-
Save hgoldwire/a3ec11331d10ca48853d1394b4170a17 to your computer and use it in GitHub Desktop.
This Works
This file contains 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
#include "Particle.h" | |
class UdpThing | |
{ | |
UDP Udp; | |
public: | |
UdpThing() {}; | |
void ready() | |
{ | |
Udp.begin(9999); | |
} | |
void go() | |
{ | |
Udp.beginPacket({54, 173, 129, 125}, 4567); | |
Udp.write("hey "); | |
Udp.endPacket(); | |
} | |
}; | |
SerialLogHandler serialLogHandler; | |
UdpThing udpThing; | |
void setup() | |
{ | |
udpThing.ready(); | |
} | |
void loop() | |
{ | |
Log.info("%d ping", millis()); | |
if (millis() > 5000) { | |
udpThing.go(); | |
} | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment