Page 1 of 1

output format of ADCtoCom1(82, 500)

Posted: 14 May 2010, 18:00 PM
by Paul Lamar
This is a nifty sub routine and almost perfect for our needs.

I need to convert the extended ASCII output characters from ADCtoCom1(82, 500)
to a decimal number characters so they can be loaded into
a spread sheet for plotting on the PC.

So far I had to run it through "more > newfile.dat"

And then searched and replaced /' with nothing.

That gave me an asci hex file that looked like "fffefffe".
Now I could process that using QB and convert it to three byte
decimal numbers but there must be a better way.

Paul Lamar

Re: output format of ADCtoCom1(82, 500)

Posted: 14 May 2010, 19:13 PM
by dkinzer
Paul Lamar wrote:This is a nifty sub routine and almost perfect for our needs.
This subroutine is provided for compatibility with BasicX. Note, particularly, that the analog input range is limited to 1.25V to 3.75V (when running on 5 volts). Analog inputs below 1.25V will result in a value of zero while inputs above 3.75V will result in a value of &Hff.
Paul Lamar wrote:I need to convert the extended ASCII output characters [...] to a decimal number characters so they can be loaded into
a spread sheet for plotting on the PC.
On the PC side, each byte will represent a value from 1.25V (0) to 3.75V (&Hff). You should be able to read the bytes, one at a time, in QuickBasic and output the decimal equivalents to a text file in a format that can be imported to a spreadsheet.