Control de Led con el comando POKE
Bueno, acá tenemos el tipico "Hello Word" de los PIC´s... encender un led
; pero en esta ocasion, vamos hacerlo un poco mas interesante... vamos hacer una seudo-animacion con el comando POKE y vamos a encender y pagar los led escalonadamente....
Código:
TRISA=$FF
TRISB=0
BUTONsubir VAR BYTE
BUTONbajar VAR BYTE
b1 VAR BYTE
SYMBOL LED=$6
BUTONsubir=0
BUTONbajar=0
b1=0
PORTB=0
inicio:
BUTTON PORTA.0,0,254,254,BUTONsubir,1,subeLED
BUTTON PORTA.3,0,254,254,BUTONbajar,1,bajaLED
GOTO inicio
subeLED:
b1=b1+1
POKE LED,b1
GOTO inicio
bajaLED:
b1=b1-1
POKE LED,b1
GOTO inicio
END