I am using an Adafruit feather 32uf lora, and am using the AirSpayce's Radiohead library as suggested in the adafruit tutorial.
How do you send a number and string together using the module? The 'send' command is
rf95.send((uint8_t *)batteryPacket, 20);
when batteryPacket is :
char batteryPacket[20] = "battery voltage is: "
This works fine. But how do you add a float or integer to this char array? It looks like itoa() is the most suggested. But I do not understand the syntax for this command.
If my battery voltage is a float 3.7, how do I send "battery voltage is: 3.7" ?
I have tried:
int batVal = batVoltage*100
//which will give me approx 3700, then I can convert on the other end
//ideally I could just send float...
itoa(batVal, batteryPacket+10, 10);
But when I run
Serial.println(batteryPacket);
it returns "battery voltage is: "
I am simply just trying to send a string over radio...
In python I would just simply do "battery voltage is:" + str(batVoltage)