electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Degree C to degree F and vise versa


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Degree C to degree F and vise versa
Author Message
blastronics



Joined: 04 Jul 2005
Posts: 64
Helped: 3
Location: Between heaven and earth


Post23 Oct 2006 18:27   

Degree C to degree F and vise versa


im doing a PIC project that controls a digital temperature sensor.
My problem is how to convert the temperature from deg C to Deg F and vise versa.
I need a routine for this...

Anybody have done this before?Neutral

p.s.

im using PIC16F877
Back to top
Google
AdSense
Google Adsense




Post23 Oct 2006 18:27   

Ads




Back to top
lambtron



Joined: 02 Nov 2005
Posts: 256
Helped: 26
Location: Portland, OR


Post23 Oct 2006 18:55   

Re: Degree C to degree F and vise versa


What programming language are you using? c/c++ or assembler?

It is quite simple in c/c++: F = 1.8 * C + 32
Back to top
jhbbunch



Joined: 21 Feb 2006
Posts: 222
Helped: 16


Post24 Oct 2006 6:21   

Re: Degree C to degree F and vise versa


It might be easier if you make it F = 18*C + 320 and adjust the decimal point on your display. That way you can do shift C four places and add it to C shifted 1 place which is the same as 16*C + 2*C = 18*C. Then add this to the 320. The shifts and add would need to be done in 16 bit math, but it's all integer math and quite simple to do.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Degree C to degree F and vise versa
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Conversion from fixed point to floating point and vise versa (4)
fixed point to floating point and vise versa on TS201 (1)
On the Propagation Criterion of Degree I and (10)
hybrid 90 degree (7)
degree project (7)
90 degree phase shifter (10)
180 degree hybrid (4)
90 degree phase splitter (1)
Measure Movment in 45 degree ? (1)
Phase Shift 10 degree ? (7)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS