Volt meter

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Volt meter

Post by jgu1 »

Hi!

I try to make a Voltmeter by using of course an analog input and write the result on LCD. I tryed several eksambles, but I dont understand the formel/calibration I have to put in caculation. I like to redout in 2 decimal Eks 2.31V and readout in display 2.31V. And how does the calculation look If I want to read in the display 0 -10V by input from 0-5V still with 2 decimal, 5Vin and readout 10.00V on diplay :?:

Will somebody give me an eksable.

Thangs in advance.

JΓΈrgen.

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: Volt meter

Post by Benj »

Hello Jorgen

The ADC function ReadAsVoltage will return the ADC result as a floating point variable containing the voltage. The function ReadAsString will return the Voltage as a string which you can output directly to an LCD.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: Volt meter

Post by jgu1 »

Hi Ben.

Ok, thankΒ΄s Ben. Of course I will try to do my best. But will you please be so kind and give me a couble of exambles, I am a little novice.

Like this: If I give an input from 0- 5V and get a readuot on the display 0.00 - 5.00V

And input from 0 - 5V and get a readout on the display 0.00 - 10.00V

Then I think I will be able to see the "ligth".

Thank's
Best regard

JΓΈrgen

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times

Re: Volt meter

Post by jadiflow »

Benj wrote:Hello Jorgen

The ADC function ReadAsVoltage will return the ADC result as a floating point variable containing the voltage. The function ReadAsString will return the Voltage as a string which you can output directly to an LCD.
Hi Ben,

Nice touch! Just what I need for my current project. I'm curious though how this is scaled - doesn't the ADC basically return a fraction of the supply voltage?
Doesn't ReadAsVoltage need the supply voltage value to work?
If I have a 3.3V supply, does that mean the max voltage I can 'measure' this way is 3.3V?

thanks for your help,

jan didden
Linear Audio

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: Volt meter

Post by Benj »

Hello Jan,

The chip voltage or the +VREF voltage is defined in the ADC component properties.

E.g. if your running on a 3.3V system then change the Vref voltage from 500 (5V) to 330 (3.3V) and the read as voltage and read as float should scale appropriatley.

Post Reply