Skip to content

Instantly share code, notes, and snippets.

@hgoldwire
Created March 22, 2017 20:45
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 hgoldwire/a3ec11331d10ca48853d1394b4170a17 to your computer and use it in GitHub Desktop.
Save hgoldwire/a3ec11331d10ca48853d1394b4170a17 to your computer and use it in GitHub Desktop.
This Works
#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