I have a problem. I'm reading the ASCII output from a radar unit that spits out a car's speed in ASCII from RS232 serial. I have it wired to the arduino via the RS232 digicute shield, and the arduino is using SoftwareSerial. The SoftwareSerial is so I can program the arduino while having the shield mounted.
When the radar is powered up, it spits out the following in ascii, with a 0x0A new line in before the first 000:
000
001
002
003
004
005
006
007
008
009
010
000
I can't get the arduino to print out anything like this. I've tried using print and write, and nothing seems to work.
When I use "Serial.write" (which prints hex, right?):
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
Serial.begin(9600);
mySerial.begin(115200);
}
void loop()
{
if (mySerial.available()) {
Serial.write(mySerial.read());
}
}
I get:
0..!.0.LH.0..!.0..H.0..!.0.SH.0..!.0.SH.0..!.0.N!.0&.H.0..!.
When I use this Serial.println:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
Serial.begin(9600);
mySerial.begin(115200);
}
void loop()
{
if (mySerial.available()) {
Serial.println(mySerial.read());
}
}
I get:
48
152
152
33
225
48
152
76
33
225
48
152... (it goes on for a while)
Does anyone have any idea what I'm doing wrong here?