I have made a small digital readout connected to a PC usb port, and sending 6 digits to a receiver ( with VirtualWire ) and displaying on some 7 seg displays.
I used Nick Gammons serial example to detect the < and > terminators, and parse the numbers between, and it worked fine.
I tested the unit with both Terminal and Megunolink.
My pals says they cant change the data from his PC ( which is running a general application that outputs the code and weight required )
and he said that it is in the format of :-
(2)(32)123456(3) The 123456 is the data I need to parse
This is evidently “start of text” “space” data "end of text " ascii codes
How would I look for the start of text ? as it is ascii 2 as opposed to ‘2’ ? or 0x02 or B00000010 ?
(2) and (3) are ASCII control codes called 'Start of text' & 'End of text' respectfully, see this so I would assume you would use if (Serial.read() == 2)
I am playing around with receiving the data with Terminal , but I dont know how to send ascii 2 then ascii 32 from terminal to the arduino.
It just sees it as separate digits...
Ahah Terminal lets you send extended ascii codes as micros with #xxx in decimal
I found the way to send the other ASCII characters using macros on Terminal, but I don't suppose we can do it with the Arduino IDE, which has the carriage return line feed problem too ?