output format of ADCtoCom1(82, 500)

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
Paul Lamar
Posts: 65
Joined: 14 May 2010, 16:01 PM

output format of ADCtoCom1(82, 500)

Post 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
Attachments
compresion-test-output.jpg
(114.63 KiB) Downloaded 1250 times
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: output format of ADCtoCom1(82, 500)

Post 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.
- Don Kinzer
Post Reply