Hi all,
I have a problem with software serial. I see normal NMEA message via hyperterminal. But Through arduino board(Duemilanove and UNO, too), I can't receive correct text on Serial Monitor but get garbage as attached screen dump.
The Code is same as softwareserial example.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
Serial.begin(57600);
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());
}
for testing coding option, I try to run below code. but the results are very weird as screen dump2. I just typed "5", but serial printing value "e 101 65 145 1100101", by default, DEC, HEX, OCT, and BIN option.
Any comments are welcome!!! Pls.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
Serial.begin(57600);
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()){
char c = mySerial.read();
// print it out in many formats:
Serial.print(c); // print as an ASCII-encoded decimal
Serial.print("\t"); // print a tab character
Serial.print(c, DEC); // print as an ASCII-encoded decimal
Serial.print("\t"); // print a tab character
Serial.print(c, HEX); // print as an ASCII-encoded hexadecimal
Serial.print("\t"); // print a tab character
Serial.print(c, OCT); // print as an ASCII-encoded octal
Serial.print("\t"); // print a tab character
Serial.print(c, BIN); // print as an ASCII-encoded binary
Serial.print("\t"); // print a tab character
Serial.println(); // print a linefeed character
}
delay(10);
}