CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Increment variable float!
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
fiasgardone



Joined: 19 Jan 2010
Posts: 71

View user's profile Send private message

PostPosted: Mon Nov 26, 2012 6:02 am     Reply with quote

asmboy wrote:
fascinating....

I could not agree more forcefully with AVOIDING Floats unless absolutely required.

I've been working the past few days on a customer, project that
replaces a water-bath microscope stage micro-incubator, with a
replacement , low cost, electrically heated design.

The lock center point is 37.0 deg C
and the total range is only 31 to 44 deg C

My solution for accurate ( after offset calibration ) of a deg C
displayed environment is to actually use the Natsemi LM34 Fahrenheit sensor - digitized on a 12 bit pic 18f2523 - and an ext a/d reference of 1.234v

The internal maths convert all values for INTERNAL use
to represent deg F as a 16 bit quantity that is 10x calibrated to deg F ,
such that 98.6 deg F is INT 986. all set point management is done with deg F resolution. And to show it, as is, you simply use %3.1w formatting.

Transfer to C (37.0 nominal ) for user display is achieved with a simple conversion function when driving the LCD for eyballs to watch.
-
A source output of 10mv /deg F is much better resolved to deal with than a direct reading 10mv / deg C.

The use of nothing but integer math with decimated DISPLAY might
"float" your maths better too.


Very Happy Very Happy Very Happy


Nice !!Thanks
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group