I have an Arduino Uno with digital pins 2 and 3 connected together to form a Tx -> Rx loopback. The following code seems to have a problem as no characters are ever received. A scope says the characters are indeed transmitted on the Tx pin. I'd be grateful for any insight you wizards can provide.
Using Arduino 1.0.3.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3,2); // rx, tx
void setup() {
Serial.begin(115200); // serial Monitor
mySerial.begin(9600); // loopback baud rate
Serial.println("SoftwareSerial loopback test...");
}
void loop() {
mySerial.write('X'); // send any character
delay(100);
if (mySerial.available())
Serial.println(mySerial.read()); // print data from loopback
}