Closed GoogleCodeExporter closed 9 years ago
"write" is a primitive method supporting only char and buffers (with length.)
Strings are not primitive data types. You want "Serial.print(temp);"
Original comment by wes...@gmail.com
on 26 Oct 2012 at 2:40
To clarify, im send my data Via bluetooth, and I need the robot to
"Serial.read" the incoming data and function accordingly. What do I need to do?
my code:
int X,Y,state;
String command;
void setup()
{
Serial1.begin(9600);
}
void loop()
{
command+= X;//sensor data
command+= ', '; //some white space
command+= Y;//sensor data
command+= state; //other data
Serial1.write(command); //send via bluetooth to robot
}
I am unable to compile this because of Serial1.write(), I get an error. How can
I send my data correctly?
Original comment by mascoloa...@gmail.com
on 26 Oct 2012 at 3:14
// do it like this:
Serial1.print(command); //send via bluetooth to robot
Original comment by paul.sto...@gmail.com
on 29 Oct 2012 at 7:07
Original issue reported on code.google.com by
mascoloa...@gmail.com
on 26 Oct 2012 at 2:02