Hi all,
I know this is a common question on how to communicate between two arduino's using serial, but i can't figure what is going on. I've attached my schematic portion on how the two are connected. I can confirm that there is an electrical connection between the two. I've connected TX to the RX between the two.
There's a lot of code online with one sender and one receiver. Ive tried most of them without any luck.
Receiver code
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
Serial.println(Serial.read());
}
Sender Code
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
Serial.write("test");
}
i've tried using atoi, serial.readbyte(), Serial.print() with no luck.
the output from the receiver side is either -1 for int or 0 for string even though i transmit different values.
i'm not sure if since the atmega32u4 has its USB priority, would it effect any data. on the arduino website it says
The Arduino Leonardo board uses Serial1 to communicate via TTL (5V) serial on pins 0 (RX) and 1 (TX).
ive also tried swapping serial1 as write and read without any luck.
does anyone have any idea whats going on?
thanks a bunch!