Simple serial communication between two arduinos

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 :wink:

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.

Arduino MICRO:
In addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data using the ATmega32U4 hardware serial capability. Note that on the Micro, the Serial class refers to USB (CDC) communication; for TTL serial on pins 0 and 1, use the Serial1 class.

Use Serial1 on your Micro.

That worked! thank you!

You are welcome. Thank you for the feedback.