At last something that works...
Okay, I now have a working Gambas program that will read a formatted RS232 data stream and display the data as a dynamic bar chart. To test this I rigged up my trusty old Psion II LZ and wrote a little OPL (Psion programming language) script to output a suitable random data stream. The project is running on a laptop at the minute because I haven't gotten Gambas onto the RasberryPi yet and apparently it is quite slow, but I love the graphics. The system is designed to work with 8 sensors and the data is 10-bit (values between 0-1023), so the format of a data frame is (at the moment) 18 bytes as follows - - 'A' as the start character, the program reads data and ignores it until it receives an A; - Pairs of bytes representing the upper and lower 5 bits of the 8 10-bit data values; - 'B' as a terminating character. To avoid confusion and make debugging easier, the 5-bit data is sent as bytes in the decimal range 32-63. The ASCII codes for A and B are 65 an...