SQR(mmH2O)*(504/65)
SQR(mmH2O)*(1543/199)
SQR(mmH2O)*(2551/329)
SQR(mmH2O)*(31116/4013)
Hint: Use MiscEl
Careful with the math overflow
SQR(mmH2O)*(504/65)
SQR(mmH2O)*(1543/199)
SQR(mmH2O)*(2551/329)
SQR(mmH2O)*(31116/4013)
Hint: Use MiscEl
Careful with the math overflow
Last edited by mister_e; - 30th May 2011 at 07:30.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Awesome stuff Steve
Thanks for your help
aajgss
ps not sure what you mean by MiscE?
Give this a try...
MiscEL
Dave
Always wear safety glasses while programming.
Got It!
Thought it was a ! and not an l - old eyes no glasses. Often get told I need them - maybe I do
Thanks
aajgss
I'm sure in the same boat... without mine I can't even say if it's an elephant ... or a supermarket![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Ok,
Lets forget I said the first bits easy!!!
Instead of converting to mmH2O and then converting that to Knots, I decided to go straight from ADC counts to Knots.
So the equation comes out to be (SQR(ADC Counts))* ( 484/79).
Excel comes up with the correct answer. for 1 ADC count the result comes out at 6.1266 knots. Doing the same calculation in a PIC the result is 6 knots. It appears that the result is the integer part only.
The numbers I am trying to get is in the table
mmH2O ________Knots
15_____________ 30
26.5 ___________40
41.5 ___________50
60 _____________60
81.5 ___________70
106.5 __________80
134.5 __________90
166.5 _________100
201 ___________110
239.5 _________120
How do I calculate the correct value and still heed Steves advice to be careful of Math Overflow?
Thanks
aajgss
Last edited by aajgss; - 3rd June 2011 at 14:55.
Hello aajgss,
What level of resolution are wanting to display, I mean how many decimal places ?
You could multiply up by 10, 100, 1000 and display using DEC modifier and "." .
I didn't notice which PIC you are using but 18Fs can use long variables which if I am not mistaken are 32 bit vars.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks