I am testing the basic Software Serial example on the arduino website, but I cant get the myserial to print

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  // Open serial communications and wait for port to open:
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only

 Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.println("Hello, world?");

void loop() { // run over and over
  if (mySerial.available()) {
  if (Serial.available()) {

In the example, digital pins 10 and 11 (mySerial) on your Arduino board are used as virtual RX and TX serial lines. The virtual RX pin (pin10)is set up to listen for anything coming in on the hardware RX serial line, and to then echo that data out the virtual TX line (pin11). Conversely, anything received on the virtual RX (pin10) is sent out over the hardware TX.

  • but can i read the message then on my hardwired serial monitor with one arduino?
    – Umbus
    Nov 23 '15 at 5:35

You would need to connect something to the pins 10 and 11 like a FT232RL breakout or another serial device. If you have another Arduino, connect the RX of that Arduino to pin 11 on the Arduino connected to the USB and give the other a simple program like:

void setup(){

void loop(){
  Serial.println("Testing mySerial on Other Arduino");

Once the above code is loaded to second Arduino, put that example code on first Arduino and connect the two together like mentioned above; tx to rx and rx to tx and load the code on first Arduino and see results.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.