Hi All...
I'm trying to understand the NewSoftSerial example...
#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());
}
}
I see tha it instansiates an instance of NewSoftSerial. Okay, simple enough.
Why in the setup function is he using the standard Serial library to set the port speed and output some text?
Then, why does he use NewSoftSerial to change the baud rate?
When i compile and run this example on my Uno, I open a terminal program, set it to the correct com port, then set the speed to 57600 and I see the Goodnight Moon text. But then I don't see Hello World. If I set my baud rate to 4800 I only see a little junk.
Can some kind soul please explain what this app is supposed to do?
Thanks...