I have a small loop that if a button is pressed it increments a count and if another button is pressed it decrements the count. If the count is 0, how do I stop it from rolling over to 255, and if the count is 255, how do I stop it rolling over to 0?
Code:SETUP: LCDOUT $FE, 1, "SET LED CURRENT" LCDOUT $FE, $C0, DEC3 IOUT IF PORTC.1 = 1 THEN IOUT = IOUT + 1 PAUSE 75 ENDIF IF PORTC.2 = 1 THEN IOUT = IOUT - 1 PAUSE 100 ENDIF pot0.lowbyte = IOUT low CS pause 1 shiftout sdo,sck,5,[pot0\16] high CS pause 1 WRITE 10, IOUT IF PORTC.0 = 1 THEN test PAUSE 75 GOTO SETUP




Bookmarks