Omni-directional robot

I am building an omnidirectional robot using 3 omni-wheels, 3 servos, a transmitter/receiver par, an arduino nano as the receiver and the transmitter is a Teensy 2.0. I am having a problem with my code and the data link between the Teensy and the arduino. In the receiver code (attached) my serial monitor giving out -1 as the data value, even when I ground the RX pin on the arduino, which should make it zero. I have been struggling with this for quite some time and I figure if I can get the data value to be 0 when the input is grounded then I will be able to make the value change by reading the value of my analog sticks with the teensy and transmitting it to the arduino. I found the code online and made some changes to try and make it work properly but its still not working. This is the website that I got the idea from.

any comments are greatly appreciated

thanks,
-James

omni_transmit.pde (1.85 KB)

omni_receive_editted.pde (5.21 KB)

sorry here is the link Omnidirectional Remote Controlled Robot

I am building an omnidirectional robot using 3 omni-wheels, 3 servos, a transmitter/receiver par, an arduino nano as the receiver and the transmitter is a Teensy 2.0. I am having a problem with my code and the data link between the Teensy and the arduino. In the receiver code (attached) my serial monitor giving out -1 as the data value, even when I ground the RX pin on the arduino, which should make it zero. I have been struggling with this for quite some time and I figure if I can get the data value to be 0 when the input is grounded then I will be able to make the value change by reading the value of my analog sticks with the teensy and transmitting it to the arduino. I found the code online and made some changes to try and make it work properly but its still not working. This is the website that I got the idea from.Omnidirectional Remote Controlled Robot

any comments are greatly appreciated

thanks,
-James
James

omni_receive_editted.pde (5.21 KB)

omni_transmit.pde (1.85 KB)

jkaps:
In the receiver code (attached) my serial monitor giving out -1 as the data value, even when I ground the RX pin on the arduino, which should make it zero.

That is incorrect. The Serial class returns -1 when there are no characters available in the buffer, or returns the next character in the buffer if available. Grounding the RX line will accomplish nothing. You have to send it valid data.

Serial.read() returns -1 if there are no bytes in the receive buffer.

Identical threads merged.
@OP: Please do not cross-post. It simply wastes time.