Yes, sorry. The last program displays 15, which is W1-60. But it does not become 30,45,60,75, etc.
Yes, sorry. The last program displays 15, which is W1-60. But it does not become 30,45,60,75, etc.
Try this code
Al.Code:count PORTC.5, 1000, W1 X1 = X1+(W1 - 60) lcdout $fe,1, dec W1 lcdout $fe,$c0, dec X1 pause 10 goto Main
All progress began with an idea
Arrati-
Thank you for your help. Although it looks good, your program does strange things! With no input on RC.5(LOW), X1 is all over the place, 126,76,20,216, etc., while W1 remains zero.
Adding the IF statement fixed it, and all is good! Thank you, Arrati.
Main:
count PORTC.5, 1000, W1
if W1 > 60 then
X1 = X1+(w1-60)
endif
lcdout $fe,1, dec W1
lcdout $fe,$c0, dec X1
pause 10
goto Main
Bookmarks