خرید بک لینک

Vote count: 0

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 please help 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);

}
}

asked 33 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 13 مهر 1395 ساعت: 1:01

صفحه بندی