Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // UDP data transmission
- String hostip = "192.168.1.58"; // describes where the UDP packet is send to
- String udpport = "8080"; // port of the UDP packet
- String msg = "Staaaart !!!";
- float V, X, Y;
- void setup() {
- Serial.begin(115200);
- delay(1000);
- Serial.println("Zaczynam wysylac dane po UDP");
- // send to UDP
- String msgUdp = "SendToUDP " + hostip + " " + udpport + " " + msg;
- Serial.println(msgUdp);
- }
- void loop() {
- X = random (70) * 0.15;
- Y = random (70) * 0.15;
- V = random (20,50) * 0.15;
- // send to UDP
- // Ramka : TAG%X=1.5&y=2.3&V=3.88
- String msgUdp = "SendToUDP " + hostip + " " + udpport + " " +"TAG%" + "X="+X + "Y="+Y + "V="+V;
- delay(500);
- Serial.println(msgUdp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement