Analog To digital

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
User avatar
jollybv
Flowcode v5 User
Posts: 376
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times

Analog To digital

Post by jollybv »

Hi Guys

This is the first time I'm working with the A/D, I'm working with a 5v PSU the input voltage is connected to (A0) with a 10mv / degree input voltage. What has lost me is once you read the value then you multiply it by 500 Temp = fmul (ATD, 500) this is what I have seen in some examples. Should I not multiply it by 100 instead Temp = fmul (ATD, 100) which will display 1 degree for every 10mv. If I have got this all wrong and it has something to do with the power supply voltage then could someone please explain it to me

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Analog To digital

Post by medelec35 »

Hi jollybv,
This explains why I use *49 /10.
There is a better way than using a formula
Take a look a both posts on here
Makes life easier for you. :D
Martin

User avatar
jollybv
Flowcode v5 User
Posts: 376
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times

Re: Analog To digital

Post by jollybv »

Hi Martin

Thanks let me give the temp = temp *49 / 10 a try, as I see the remapping is for Arduino and I'm working with PIC. I did try the remapping but could not find user

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Analog To digital

Post by medelec35 »

jollybv wrote:as I see the remapping is for Arduino
No not at all.
Mapping is for all target devices including PIC.
The test file I attached is tried on PIC hardware.
jollybv wrote: I did try the remapping but could not find user
It is intended for Flowcode V8 only.
Just tried and will not work on for V7.
If your flowchart does not work with the formula, then I will take a look at it for you.
Martin

User avatar
jollybv
Flowcode v5 User
Posts: 376
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times

Re: Analog To digital

Post by jollybv »

Hi Martin

I have used the formula it works quite nicely but the accuracy is about 2 degrees off. What I have done to try to solve the problem is after temp = temp / 10 I add 2 to temp.
Also, do you perhaps know how I would go about making a temperature PID

Post Reply