Hi,
Im working on a personal project to add a display to a serial device. I've been able to connect to it Via-PuttY and I can get the output fine from putty. it basically starts in burst mode displaying
** 1PROBE **
** 1PROBE **
** 1PROBE **
** 1PROBE **
** 1PROBE **
(etc...)
Basically it outputs the number probe (can either be 1 or 2) and then it ends each line with ASCII char 13 (carriage return) and then ASCII char 10 (new line)
After that you can send commands to the device via some ASCII (200 - 210)
Baud Rate is 57600
8 data bits
1 stop bit
no parity
From what I've read these are also the default values for the serial in Arduino (except the baud rate), so I dont believe I have to modify these.
I'm going over various examples of Serial communications and I've tried many of them but I keep getting weird outputs. I am confused as whether to use Serial. or SoftwareSerial.
I tried changing it to CHAR instead of ASCII but It still doesnt display what it should.
The current output is some weird stuff
I tried the following:
http://www.arduino.cc/en/Tutorial/SoftwareSerialExample (modified baud rate)
Most of the other examples are slight variations of the link above.
I tried changing
Serial.write(mySerial.read());
to
Serial.println(char(mySerial.read()));
and it did output different characters, however it didnt output ** 1PROBE **.
Additionally it only outputted 1 character per line.
I wanted help on the following:
-
First and most important, how do I get it to output the correct information? (** 1PROBE** )
-
How to set it to read up to ASCII char 10 and then print a new line (or ASCII 13?), I am thinking this should be a serial event? (I wanted help with this)
-
is there a way to make this some more effective void() loop? (every time I run it arduino seems to freeze for a moment before opening the serial monitor). I tried adding delays but it still seems to freeze up the software a little. I intend to add a display so I am not sure if the processor will be able to handle this loop and the display management.
Thank you for your help!