am building a RC robot, using edited code from online, and having a problem with the communication between the controller and the receiver.I am trying to test the data link between a Teensy 2.0 and an Arduino Nano 3.0. I have code on the teensy to make it output “5”. However, when I have the serial monitor read the data on the arduino it keeps coming as -1. I am trying to get the link to work properly so that I can have the teensy read the value of analog sticks and then wirelessly transmit it to the arduino. But for now I have a wire connecting the RX pin on the arduino Nano to the TX pin ( 8 ) on the teensy to see if I can get them communicating. I am not sure if this is a code problem or a mechanical problem but I do know both the arduino and the Teensy work fine. I have attached the Teensy code(print 5) as well as the arduino code (receive) and I added the code I will have on the teensy once I get the data link working if you are curious.
I am trying to build a remote control robot that uses a Teensy 2.0 in the controller and an Arduino nano 3.0 in the receiver. I know that the Teensy, the transmitter/receiver, and the arduino work fine, but the serial communication is not working. Does anyone know how to get the two boards communicating with serial date, is there a different protocol? If anyone knows of or has any sample code that has a Teensy sending serial data to an arduino I would greatly appreciate it.
Troubleshooting code can certainly be frustrating. Did you check the baud rates? Are you certain you are using the Teensy’s serial line, connected to the Arduino’s Rx line? There are many factors involved.
You basically need to troubleshoot the issue and we can only provide some suggestions. Can you try communication in the opposite direction? Use the computer to read and display the serial line to ensure it is being sent properly, and then create a bit fo code for the Teensy to “regurgitate” a number you input. This will ensure the code is correct and a number being sent from one to the other will remain unchanged (assuming correct baud rate).