Define CONF_WORD = 0x3f50
Define CLOCK_FREQUENCY = 4
AllDigital
TRISA = %11111111
TRISB = %00000000
Dim boton As Byte
'PORTA = 0
PORTB = 0
boton = 0
main:
If PORTA.0 = 1 Then Gosub botonmas1
Goto main
End
'Subrutinas
botonmas1:
boton = boton + 1
WaitMs 1 '200
If boton = 1 Then Gosub comando1
If boton = 2 Then Gosub comando2
If boton = 3 Then Gosub comando3
If boton >= 4 Then boton = 0
Return
comando1:
PORTB.0 = 1
Return
comando2:
PORTB.2 = 1
Return
comando3:
PORTB.4 = 1
Return
'End