UTMonkey
Member
Hi All,
LED Mux got me confused at first but the penny has dropped.
I am trying now to get the lights on this kit to come on simultaneously (or appear to).
Look at the following code (Created by Bill, smegged up by me)
I was hoping this would appear to turn on LED's 1,3 and 5, instead it appears to be turning them all on.
Am I missing something?
Regards
Mark
LED Mux got me confused at first but the penny has dropped.
I am trying now to get the lights on this kit to come on simultaneously (or appear to).
Look at the following code (Created by Bill, smegged up by me)
list p=18F1320
include <p18F1320.inc>
CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF, DEBUG = ON
LED macro x,y ; MACRO LED <PORTA>, <TRISA>
movlw x
movwf LATA ; LATA = x
movlw y
movwf TRISA ; TRISA = y
endm ; end macro
org 0 ; reset vector
bsf ADCON1, 0 ; make RA0 digital
START
LED1 LED b'00000001', b'10111110' ; LED <PORTA>, <TRISA>
LED3 LED b'01000000', b'00111111'
LED5 LED b'10000000', b'01111110'
goto START ; loop forever
END
I was hoping this would appear to turn on LED's 1,3 and 5, instead it appears to be turning them all on.
Am I missing something?
Regards
Mark