Hi,
I've been tinkering with getting two arduinos talking to each other over serial but I'm really hitting a wall here.
I've been trying to find tutorials on this but I want to start simple and most of them that I've found are more complex with other components and stuff. All I want to do for now is send a single character or integer from one arduino to another.
I'm using an arduino micro to send the data and an uno to receive. I have the TX pin on the micro going to the RX on the uno and the RX on the micro going to the TX on the uno. Both are using the same ground.
Here is my code for each. Keep in mind that I am extremely new to this and it's probably something simple to fix it. I'm also not very familiar char or other types besides int so be nice
Uno:
char rcvd;
void setup() {
Serial.begin(9600);
Serial.println("Is this on?...");
}
void loop() {
if(Serial.available() > 0) {
rcvd = Serial.read();
Serial.println(rcvd);
}
}
Micro:
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.write("A");
delay(1000);
}
EDIT:
I forgot to say what was wrong. The micro seems to be spitting out the letter A just fine. When I open the serial monitor for the micro I see A come up every second. But when I plug in the uno and check its monitor I get the "is this thing on?..." and then nothing. It doesnt seem to be receiving what the micro is sending.