I guess there something fundamental that I do not understand.
I try do some simple test to check whether my softwareSerial is working.
I did wire the software TX (pin 9) to the hardware RX (pin 0) writing every second a message to the software serial. I would expect that this message shows up in the Serial Monitor (configured at 9600). However, this fails, I only get to see the message that is sent to the hardware serial during setup().
For the wireing I tried a 1K resistor as well as connecting the two pins directly. I tried this on an arduino uno as well as on a nano. The nano has an RX-led which blinks once a second. So I know something is arriving there.
What do I not understand?
#include <SoftwareSerial.h>
SoftwareSerial xbSerial(8, 9); // RX, TX
void setup() {
xbSerial.begin(9600);
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Goodnight moon!");
}
void loop() {
// the xbSerial TX is wired to the hardware RX, expecting
// to see this message once a second on the serial monitor
xbSerial.println("ldkajfdsalkjfdslkfjdslkfjdsalökfjdslkfjdsalkfsdlkfj");
delay(1000);
}