I am trying to connect my Pi 4 running Rasbian 2020 to an Arduino, after making all the connections I try to communicate with the Arduino by using Minicom. However, Minicom doe not respond to anything I am typing nor any of the commands such as ctrl + a
.
I am running Minicom with the following command:
minicom -b 9600 -o -D /dev/ttyAMA0
This is the code I have running on the Arduino:
byte number = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
if (Serial.available()) {
number = Serial.read();
Serial.print("character recieved: ");
Serial.println(number, DEC);
}
}
/dev/ttyAMA0
exists on your RPI ?-o
is really necessary ? – Ephemeral Mar 08 '22 at 23:36if (Serial.available()) {}
must beif (Serial.available() > 0){}
, I check if it is important – Ephemeral Mar 08 '22 at 23:47int bytesSent = Serial.write("hello");
in your loop beforeif (Serial.available()) {}
to see if you see anything in minicom ? – Ephemeral Mar 09 '22 at 00:00it's <CTRL>+<A>, then <Z>
, you can also usescreen
instead ofminicom
– Ephemeral Mar 09 '22 at 00:12<CTRL>+<A>
is supposed to set you into special inputs so you can use the keys for a plethora of commands... not just thez
. The<CTRL>+<A>
command is not doing that for me.Also the
– Beulah Akindele Mar 09 '22 at 00:18Serial.write
did nothing.screen
? help – Ephemeral Mar 09 '22 at 00:21screen /dev/ttyAMA0 9600
– Beulah Akindele Mar 09 '22 at 00:29