In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Mike_W wrote: Here is what I came up with. It displays degrees Fahrenheit, whole degrees only no fraction. I am still using the CNVRT_F subroutine from the C_to_F__V3 mike-cook posted. I changed the first few lines that got rid of the fractional part. After converting to Fahrenheit, degrees F advances 1 degree every .5 degrees C. from the thermometers I have to check it by it seems to work ok. I have a question about these lines of code. They advance the clock registers to set the clock when a button is pushed. Is there any way to optimize this routine to save program memory and achieve the same result. SET_CLOCK: DO ' IF BtnMins = 0 THEN ' minutes INC Mins ' Mins = Mins // 60 ' minutes = 0 to 59 LCD_OUT LcdLine0_11 ' GET_DEC Mins WAIT_MS 250 LOOP UNTIL BtnMins = 1 ENDIF DEC2BCD Mins Mins = tmpB2 ' ------------------------ DO ' IF BtnHrs = 0 THEN ' hours INC Hrs ' Hrs = Hrs / 13 ' hours 1 to 12 Hrs = __REMAINDER | Hrs ' IF Hrs = 12 THEN ' tmp1 = ~tmp1 ' change AM PM ENDIF LCD_OUT LcdLine0_8 GET_DEC Hrs WAIT_MS 250 LOOP UNTIL BtnHrs = 1 ENDIF DEC2BCD Hrs Hrs = tmpB2 Hrs_Bit_5 = tmp1 ' change am pm bit Hrs_Bit_7 = 1 ' has to stay 1 for 12 hr ' ------------------------ Thanks, Mike ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=265181#m267595 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)