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
Analog To digital
Moderator: Benj
-
- 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
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.
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.
Martin
- 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
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
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
-
- 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
No not at all.jollybv wrote:as I see the remapping is for Arduino
Mapping is for all target devices including PIC.
The test file I attached is tried on PIC hardware.
It is intended for Flowcode V8 only.jollybv wrote: I did try the remapping but could not find user
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
- 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
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
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