@ DEVICE MCLR_OFF, INTRC_OSC, WDT_OFF, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF
CMCON = 7
TrisA=%11111111
TrisB=%00000000
PORTA = %00000000
PORTB = %00000000
Aumen var word
aumen=1
cartel:
portb = 0
if porta.7 = 1 then
pause aumen
gosub ache
pause 1
aumen=aumen+1
if aumen=60 then retrocede
endif
goto cartel
retrocede:
portb = 0
if porta.7 = 1 then
pause aumen
gosub ache
pause 1
aumen=aumen-1
if aumen=0 then cartel
endif
goto retrocede
ache:
portb = %11111111:pauseus 100
portb = 0:pauseus 800
portb = %00010000:pauseus 100
portb = 0:pauseus 800
portb = %00010000:pauseus 100
portb = 0:pauseus 800
portb = %00010000:pauseus 100
portb = 0:pauseus 800
portb = %11111111:pauseus 100
portb = 0:pauseus 800
return
O:
portb = %01111110:pauseus 100
portb = 0:pauseus 800
portb = %10000001:pauseus 100
portb = 0:pauseus 800
portb = %10000001:pauseus 100
portb = 0:pauseus 800
portb = %10000001:pauseus 100
portb = 0:pauseus 800
portb = %01111110:pauseus 100
portb = 0:pauseus 800
return
ele:
portb = %11111111:pauseus 100
portb = 0:pauseus 800
portb = %10000000:pauseus 100
portb = 0:pauseus 800
portb = %10000000:pauseus 100
portb = 0:pauseus 800
portb = %10000000:pauseus 100
portb = 0:pauseus 100
portb = %00000000:pauseus 100
portb = 0:pauseus 800
return
a:
portb = %11111110:pauseus 100
portb = 0:pauseus 800
portb = %00010001:pauseus 100
portb = 0:pauseus 800
portb = %00010001:pauseus 100
portb = 0:pauseus 800
portb = %00010001:pauseus 100
portb = 0:pauseus 800
portb = %11111110:pauseus 100
portb = 0:pauseus 800
return
espacio:
portb = %00000000:pauseus 100
portb = 0:pauseus 800
portb = %00000000:pauseus 100
portb = 0:pauseus 800
portb = %00000000:pauseus 100
portb = 0:pauseus 800
portb = %00000000:pauseus 100
portb = 0:pauseus 800
portb = %00000000:pauseus 100
portb = 0:pauseus 800
return
end