Arduino micro rx error to xbee (tx works fine)

I’m using the arduino micro and it is connected to an xbee using the softwareserial libraries to comunicate. transmitting works fine but receiving doesn’t work (code is attached).

the usb serial connection works and receives the value of 0 when data is being sent.
The xbees work fine and have been tested.

Any idea on what i’m doing wrong?

SoftwareSerialExample.ino (1.53 KB)

Any idea on what i'm doing wrong?

Yep. Right here:

SoftwareSerial mySerial(0, 1); // RX, TX

Do NOT do software serial on the hardware serial pins. They are already being used as hardware serial pins.

Also, not all of the pins on the Micro can be used for RX. Look at the SoftwareSerial page and follow the valid pins for the Leonardo.