Skip to main content
Bumped by Community user
added 196 characters in body
Source Link

OK, I'm working on a remote controlled robot. Both the robot and the remote use Arduino with a Bluetooth shield. The Bluetooth is working and I need to send something similar to this over Bluetooth:

X:1026,Y:1026,Button:1

There may be more buttons added and X,Y can be between 1026 and 0. How can I build that string from:

 yPosition = 1026;
 buttonState = 0;```

I also need to be able to separate that string back into variables on the 2nd Arduino. 

EDIT: I have seen other questions similar to this but they involved Serial. I am using Bluetooth.  

EDIT AGAIN: I am sending the data over Bluetooth with the `BlueToothSerial.print` command from the `SoftwareSerial.h` library. (`BlueToothSerial` is `SoftwareSerial BlueToothSerial(RxD,TxD);`)

OK, I'm working on a remote controlled robot. Both the robot and the remote use Arduino with a Bluetooth shield. The Bluetooth is working and I need to send something similar to this over Bluetooth:

X:1026,Y:1026,Button:1

There may be more buttons added and X,Y can be between 1026 and 0. How can I build that string from:

 yPosition = 1026;
 buttonState = 0;```

I also need to be able to separate that string back into variables on the 2nd Arduino. 

EDIT: I have seen other questions similar to this but they involved Serial. I am using Bluetooth. 

OK, I'm working on a remote controlled robot. Both the robot and the remote use Arduino with a Bluetooth shield. The Bluetooth is working and I need to send something similar to this over Bluetooth:

X:1026,Y:1026,Button:1

There may be more buttons added and X,Y can be between 1026 and 0. How can I build that string from:

 yPosition = 1026;
 buttonState = 0;```

I also need to be able to separate that string back into variables on the 2nd Arduino. 

EDIT: I have seen other questions similar to this but they involved Serial. I am using Bluetooth.  

EDIT AGAIN: I am sending the data over Bluetooth with the `BlueToothSerial.print` command from the `SoftwareSerial.h` library. (`BlueToothSerial` is `SoftwareSerial BlueToothSerial(RxD,TxD);`)
Source Link

Arduino join multiple strings and numbers and then seperate them

OK, I'm working on a remote controlled robot. Both the robot and the remote use Arduino with a Bluetooth shield. The Bluetooth is working and I need to send something similar to this over Bluetooth:

X:1026,Y:1026,Button:1

There may be more buttons added and X,Y can be between 1026 and 0. How can I build that string from:

 yPosition = 1026;
 buttonState = 0;```

I also need to be able to separate that string back into variables on the 2nd Arduino. 

EDIT: I have seen other questions similar to this but they involved Serial. I am using Bluetooth.