Hi am trying out this example for newsoftseril and i dont seems to get the print statement working on my serial monitor. In this case when the serial monitor is on baud 57600 i can see "Goodnight moon!" print. But when I change the baud to 4800 or any other baud nothing shows up. please help. :exclamation
#include <NewSoftSerial.h>
NewSoftSerial mySerial(2, 3);
void setup()
{
Serial.begin(57600);
Serial.println("Goodnight moon!");
// set the data rate for the NewSoftSerial port
mySerial.begin(4800);
mySerial.println("Hello, world?");
}
void loop() // run over and over again
{
if (mySerial.available()) {
Serial.print((char)mySerial.read());
}
if (Serial.available()) {
mySerial.print((char)Serial.read());
}
}