Say hello to everyone,
where is the fault in this example:
ButtonPress var BYTE ' Button Counter Variable
LongPress con 20 ' Change this value for desired SET
' function trip-point in 50mS steps
' Currently set for 1 Second
MainLoop:
LCDOut $FE,1,"Go Press..."
ButtonLoop:
Gosub GetButton
If ButtonPress>0 then
If ButtonPress=1
LCDOut $FE,1,"Short Press"
else
LCDOut $FE,1,"Long Press"
endif
Pause 1000
Goto MainLoop
endif
Goto ButtonLoop
'
' Subroutine weighs-up users finger
' in multiples of 50mS
' Constant LONGPRESS determines boredom level
' -------------------------------------------
' on Exit...
' ButtonPress=0 - No Press
' ButtonPress=1 - Short Press
' ButtonPress=2 - Long Press
GetButton:
ButtonPress=0
While MyButton=0
If ButtonPress<255 then ButtonPress=ButtonPress+1
Pause 50 ' This is also our Debounce value
If ButtonPress=LongPress then LCDOut $FE,1
Wend
If ButtonPress>0 then
If ButtonPress=>LongPress then
ButtonPress=2
else
ButtonPress=1
endif
endif
Return
I have this Sample code compiled and get this error message:
ERROR Line 18: Bad expression or missing THEN, (Button_01.php)
See attachment
I am here new and am pleased about every help.
Konrad
Bookmarks