Hi all
ive added my flowchart and im having issues with the value of the adc regards what it shows on the display. ive got the variable DISPLAY[4] as a string therefore to my understanding i should only show the 4 segments of the selected display ie 2.04V but im getting for instance 2.043256, four extra digits, my code has been scaled down by eliminating certain macros etc to try to find the issue but as yet the problem remains, ive tried adding print string "" at various points in the VOLTAGE macro with no joy. also ive only added the loop in the VOLTAGE macro to constantly show the issue.
if i build the same VOLTAGE macro in a new code on its own it shows the correct number of digits ie 2.04v and not 2.045612, so theres something in my code its not liking but its hidden deeper than i can find, i would appreciate any help once again
cheers bob
ADC VALUE ISSUES
Moderator: Benj
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: ADC VALUE ISSUES
Hi, Bob.
Instead of use
The 2 is the number of decimal places.
Instead of
Code: Select all
DISPLAY = FloatToString$ (SHOW)
Code: Select all
DISPLAY = FloatToString$ (SHOW,2)
Martin
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 24 times
Re: ADC VALUE ISSUES
hi martin,
as always thanks for the reply, you were spot on this now works a treat, however i dont understand how the program runs correctly if the voltage macro is built on its own and then in my program acts the way it does ?? however your solution is brill, ive never seen this done before but its one to remember, massive thanks for your advice cheers
regards bob
as always thanks for the reply, you were spot on this now works a treat, however i dont understand how the program runs correctly if the voltage macro is built on its own and then in my program acts the way it does ?? however your solution is brill, ive never seen this done before but its one to remember, massive thanks for your advice cheers
regards bob
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: ADC VALUE ISSUES
Hi, Bob.
You're welcome.
I'm glad my suggestion works for you.
Thanks for keeping us updated.
You're welcome.
I'm glad my suggestion works for you.
Thanks for keeping us updated.
Martin