1

The problem: Message prints only to the Arduino IDE's Tools > Serial Monitor, not coming out of TX pin 11. Question, please how to get Arduino Uno or Mega to send data out of pin 11?

#include <SoftwareSerial.h>
SoftwareSerial mySerial(12, 13); // RX, TX pins on Arduino
void setup() {
  Serial.begin(9600);
}
void loop() {
  Serial.print("This is a test\n\n");
  delay(1000);
}
1
  • 1
    Where in that code are you doing anything at all with pin 11?!
    – Majenko
    Commented Jul 27, 2016 at 14:32

1 Answer 1

3

Of course it's only coming out on the serial monitor - you are printing it to the hardware UART which comes out on the serial monitor.

You have created a SoftwareSerial object which you are then completely ignoring and then using the HardwareSerial UART object instead, which is on pins 0/1.

If you want to use a SoftwareSerial object you should actually use the SoftwareSerial object.

Replace all the references to Serial with mySerial instead.

2
  • Thank you for the speedy answer. I will try that immediately. Commented Jul 27, 2016 at 14:38
  • I change to my Serial and had to add mySerial.begin(9600). Now it works. Thank you Majenko. Commented Jul 27, 2016 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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