In SX Microcontrollers, SX/B Compiler and SX-Key Tool, kd5dhu wrote: Ok, this looks like it should work for temperatures +/- 63ºC to +/-ºF. Check my math, I run it several times and can't seem to find anything wrong with it. All done in bytes. [code] MAIN: sign = 0 for idx = 0 to 63 degC = idx degF = degC * 4 ' convert to Fahrenheit degF = degF / 5 degF = degF + degC IF sign = 1 THEN TX_BYTE NEGATIVE TX_DEC3 idx TX_STRING " " IF degF > 32 THEN degF = degF - 32 TX_BYTE NEGATIVE TX_DEC3 degF ELSE degF = 32 - degF TX_DEC3 degF ENDIF ELSE degF = degF + 32 TX_DEC3 idx TX_STRING " " TX_DEC3 degF ENDIF TX_STRING "F " TX_STRING CrLf NEXT Finish: END [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=113423#m113883 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)