without a schematic its a bit difficult to intrepret whats going on in your code
wired like this , i made a table on whats needed to light each led
here is an example for a pic16f1825 to light each led in sequence
Ps code in code tags is ten times easier to interpret
Code:'**************************************************************** '* Name : charlieplex.pbp * '* Author : richard * '* Notice : * '* : * '* Date : * '* Version : 16f1825 @3.3 volts * '* Notes : * '* : * '* '**************************************************************** #CONFIG __config _CONFIG1, _FOSC_INTOSC & _CP_OFF & _WDTE_ON & _PWRTE_ON & _MCLRE_ON & _CLKOUTEN_OFF __config _CONFIG2, _PLLEN_ON & _LVP_OFF #ENDCONFIG DEFINE OSC 32 led var byte tmp var byte OSCCON=$70 ANSELA=0 ANSELC=0 'TRISA = 0110 'porta.0=1 'pause 4000 'serout2 PORTA.0,84,[ "charlieplex",13,10] mainloop: for led=0 to 11 lookup led,[12,12,9,9,3,3,5,5,6,6,10,10],tmp TRISC = $f0|tmp lookup led,[ 2, 1,4,2,8,4,8,2,8,1 ,4, 1],tmp latC = tmp pause 200 next goto mainloop




Bookmarks