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.
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
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.