void setup() {
Serial1.begin(9600); // Hardware Serial on pins 18 (RX1) and 19 (TX1)
}
void loop() {
Serial1.println("1");
delay(1000);
Serial1.println("2");
delay(1000);
}
It doesnt show anything on the serial monitor. If i use serial not serial1, it works. But i want to use serial1 for the hardware serial to send data to a raspberrypi.
Yes i tried using a level converter from 5v to 3.3v but that's aside from the point, the arduino just wouldnt send anything on the hardware serial1.
the data is coming from the code i provided, it just repeats sending 1 or 2. I am expecting the pi to be able to read the data on the other side. But all i see from the raspberry side is the letter K over and over again.
The pi is receiving the data but no matter what data i sent, it only shows the letter K. I did decode it properly in python, ive done this without pi before but for some reason its only showing k in this case.
I could only see if serial is used but cannot see if serial1 is used. Can see both on the terminal receiving using pi but can only see the letter k is serial1 is used.
Yes i tried with both a level converter with a common GRD and tried without, same problem.
connecting serial1 pins 19 and 18 from arduino to the gpio14 and 15 or raspberry pi. Not connecting serial only serial 1. The Ground is also connected. I tried the connections i mentioned using a level converter and tried without. Same results, all i see from the pi side is the letter k.
The resistor network in @runaway_pancake's diagram is a voltage divider that takes care of that. It's only important for the Tx from the Mega to the Rx of the Pi.