ADC voltage

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
wardnica
Posts: 13
Joined: Wed Jun 08, 2011 1:46 pm
Has thanked: 1 time
Contact:

ADC voltage

Post by wardnica »

I'm trying to measure a voltage that my anemometer transmits with my 16F690, (voltage range between 0 - 5 V.)

(flowcode 4)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ADC voltage

Post by Benj »

Hello,

You should just be able to use the ADC component to sample and read back the voltage.

wardnica
Posts: 13
Joined: Wed Jun 08, 2011 1:46 pm
Has thanked: 1 time
Contact:

Re: ADC voltage

Post by wardnica »

Image

this error
Attachments
test.fcf
when i try to compile to the chip, i get an error.
(6.5 KiB) Downloaded 289 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ADC voltage

Post by Benj »

Your Vin variable is a Byte.

Try creating a float variable and then use this to collect the voltage. Once you have done this you should be able to convert the float to a byte correctly.

Post Reply