I'm trying to send position of my robot through wireless module with Arduino using Software Serial library. I found that it can only send 1 byte at time. I can't send more than number 255 and I need to send floats till 40000. How I can do that?
Here is an example of my transmitter:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() // run over and over
{
float i=40000;
mySerial.write(i);
//Serial.println(i);}
}
my reciever
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10,11); // RX, TX
int i=0;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() {
if(mySerial.available()){
i=mySerial.read();
Serial.println(i);
}
}