Hello all !
I am trying to check the status of several push buttons with basically the same treatment. I initially tought I could do something along the following line:
;Chip Settings#chip 16F690, 8
#config FOSC_INTOSC, WDTE_OFF
#define Red_button porta.0 ;Set red pushbutton
#define White_button porta.1 ;Set white pushbutton
;#define other buttons
Dir Red_button In
Dir White_button In
Sub Test_button(Button)
If Button On Then
; Some treatment here
End if
end sub
do
Test_button(Red_button)
Test_button(White_button)
; test other buttons
loop
But this does not work (compiles ok but get "Symbol does not exist" msg when assembling).
Any idea for a work around ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all !
I am trying to check the status of several push buttons with basically the same treatment. I initially tought I could do something along the following line:
But this does not work (compiles ok but get "Symbol does not exist" msg when assembling).
Any idea for a work around ?
Very easy to overlook. An equals sign in your if-then statement. You need to ensure you have a complete conditional test.
Sub Test_button(Button)
If Button = On Then
; Some treatment here
End if
end sub
Anobium
My bad :-)
Thanks Anobium