In the above code, Only the string "released" is printed /written into the PC . But the Buffer Data is not written into the PC.
What happens if you do it in separate packets?
Hi sir. Thanks for the reply.
You have mentioned seperate Packets as like this?
if(button.isPressed())
{
ReplyBuffer[0] =1;
ReplyBuffer[1] =2;
ReplyBuffer[2] =3;
ReplyBuffer[3] =4;
ReplyBuffer[4] =5;
Serial.println("The button is pressed");
Udp.beginPacket("192.168.100.46", 23);
Udp.write(ReplyBuffer,5);
Udp.endPacket();
}
Not able to understand sir. Please let us know clearly.
Sir. I have to send the following Hexadecimal data to the PC using the Udp.Write(Buffer, Size) option. what i did is:
byte ReplyBuffer[5];
if(button.isPressed())
{
ReplyBuffer[0] =0x01;
ReplyBuffer[1] =0x02;
ReplyBuffer[2] =0x03;
ReplyBuffer[3] =0x04;
ReplyBuffer[4] =0x05;
Serial.println("The button is pressed");
Udp.beginPacket("192.168.100.46", 23);
Udp.write(ReplyBuffer,5);
Udp.endPacket();
}
The above code is not writing the buffer data into the PC. what is the code we have to change for it. Kindly help.