Hi,
New to this forum and Arduino. I already did some research on this topic but i could not understand clearly, I would like to get some guidance. I'm using two arduino, one Uno and nano with RF22 each.
i want to send 12int parameters and 5char,5 floats from client to server. client side im reading inputs from serial monitor and sending to server over rf22 wireless.
i am able to send one parameter properly, how do i differentiate and receive multiple parameters from serial monitor and receive the same in Server side.
Below is my code for one parameter
Client :
void loop()
{
if(Serial.available()>0)
Serial.println("Sending to rf22_server");
String Int1= Serial.readStringUntil('\n')
int x= atoi(Int1.c_str());
rf22.send((uint8_t*)&x, sizeof(x));
Serial.println(x);
}
Server:
void loop()
{
if (rf22.available())
{
uint8_t buf[RF22_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
if (rf22.recv(buf, &len))
uint8_t temp=((uint8_t)buf);
serial.println(temp);
}
}