some things can cause this. Let's look this snip
You exit several time from a IF THEN and/or a nested IF THEN ELSE with a goto... not a good practice. You probably overflow the stack pointer.Code:IF AL=88 THEN IF SONDU=1 THEN ARA 'if already off then ara GOSUB SON 'gosub off GOTO START ENDIF
as i read SONDU will be 0 or 1 so
about the BUTTON statement... i'm not a fan of this statement. i'll prefer do 2-3 lines myself.Code:ReturnToStart var Bit Start: ReturnToStart = 0 IF AL=88 THEN IF SONDU=0 THEN GOSUB SON 'gosub off endif ReturnToStart = 1 ENDIF if ReturnToStart then GotoStart
Let's say i want to monitor a pushButon on PORTA.1
Code:TRISA.1=1 PushButton VAR PORTA.1 start: If PushButton then ' Pushbutton active While PushButton ' wait untill it's release Wend Pause 50 ' debounce time Gosub XYZ endif




Bookmarks