The Serial Monitor shows what is send via hardware serial.
To see what is send via softwareserial (pin11), you have to connect a serial/usb adapter to that pin.
If you have another Arduino you can use that as serial/usb converter
Hi Herni,
thank's for you reply.
I don't undestand... when something come out from pin11 (TX) throught the loopback come in from pin10 (RX), so datas are available on software serial port. Then sketch read this datas and write it to hardware serial port (direct to serial monitor).
Isn't what do the sketch in the example?
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(57600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(4800);
mySerial.println("Hello, world?");
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
NOTE: I've connect pin 10 and 11 (with a resistor in first case, jumped in second case) in my arduino nano.
Peterd51:
Isn't it risky to directly connect one port to another without a resistor to limit the current?
Only if both pins are configured as output. Pins configured as input draw minimal current (so-called input leakage (datasheet Iil and Iih)). A pin used as TX is an output, a pin used as RX is an input.