In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tdg8934 wrote: I am trying to modify the SXB Example code for the Clock / Timer. This counts up and I want it to count down to tell me how many days and hours or so till Christmas. I have adapted it for the Sure Electronics 0832 display. In the attached code, you will see in the interupt for 'secs' that checks this byte variable for any number below or lower than zero (0). The attached code and Youtube video is currently set up now to skip 0 and just go back to 59. [code] Update_Timer: INC ms ' update ms counter IF ms = 1000 THEN ' check for 1 second ms = 0 DEC secs IF secs = 0 THEN ' check for new minute [b]'IF secs < 0 THEN ' This is what it should be but get strange display chars[/b] secs = 59 DEC mins IF mins = 0 THEN ' check for new hour mins = 59 DEC hrs IF hrs = 0 THEN ' check for new day hrs = 23 DEC days IF days = 0 THEN days = 99 ENDIF ENDIF ENDIF ENDIF ENDIF [/code] If I change it to check for a number lower than 0, then the ascii that is displayed is strange like: I5, then counts down to H5, etc.. Where is this comming from. Are numbers less then 0 negative or does it equal 128 or something? [url=http://www.youtube.com/watch?v=qfYYjz1V1lg][u]http://www.youtube.com/watch?v=qfYYjz1V1lg[/u][/url] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=398272 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)