It is exaclty the same other people have done but I do not know what I have done wrong:
Arduino UNO: TX--> RX of arduino micro
Arduino UNO: RX ---> TX of arduino micro.
common GND.
Code for arduino uno: (sender)
void setup()
{
Serial.begin(9600);
}
void loop() {
//--- display the character just sent on console ---
Serial.println( "Hello world" );
delay(1000);
}
Code for receiver (micro):
void setup()
{
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
int temp=Serial.read();
Serial.println(temp);
} else {
Serial.println("Not available data");
}
delay(1000);
}
Try it with two Arduino Uno and it works. Does it mean that my micro is problematic or I missed something about micro that I should do?
Yes, you have missed something. The Micro is like the Leonardo. The TX and RX pins are not connected to the Serial instance. They are connected to the Serial1 instance, which is separate from the USB-to-serial converter instance that Serial is connected to.