Hi Chris,
In your test routine loop you're re-Writing alot of static text on the LCD and you're doing some "strange" things to get the correct formating. Here's an idea which probably is a bit more efficient:/Henrik.Code:' Print static information on LCD once, then leave it alone. lcdout $FE,$80, "Measurement " lcdout $FE,$C0,"TST ANGLE: " '************************** TESTING ROUTINES HERE ************************** test: If portC.5 = 0 then clearall if enc_counter <> enc_counter_old then 'see if value has changed enc_counter_old = enc_counter ' move new value to old Counter = enc_counter Sign = Counter.15 ' Save sign Counter = ((ABS Counter) * 25) ' Degrees is now 0 to 900 ' Not doing this here, later (or not at all). 'If Sign THEN Counter = -Counter ' Restore sign, value is now -900 to 900 LCDOUT $FE, $CB 'Position cursor at 11th character on 2nd row. IF SIGN THEN LCDOUT "-" ELSE LCDOUT " " ENDIF LCDOUT DEC Counter / 100, ".", DEC Counter // 100, " " ' To save execution cycles you're better off not using HIGH/LOW low ledUp 'turn off CCW led low ledDown 'turn off CW led ' If the only purpose of the Counter variable is to display the value ' the there's no need to restore the sign of it so the following line ' could be deleted. If Sign THEN Counter = -Counter ' Restore sign, value is now -900 to 900 endif goto test
Bookmarks