0% found this document useful (0 votes)
35 views86 pages

Matrix Led

This document discusses an LED matrix project and provides instructions on how to build and program an 8x8 LED matrix. It explains that an LED matrix uses individual LEDs arranged in a grid to display pixels or dots. It then provides details on the components needed, including microcontrollers, resistors, wires and an LED matrix board. It also includes a link to a forum thread with additional information and examples of code to control the LED matrix.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views86 pages

Matrix Led

This document discusses an LED matrix project and provides instructions on how to build and program an 8x8 LED matrix. It explains that an LED matrix uses individual LEDs arranged in a grid to display pixels or dots. It then provides details on the components needed, including microcontrollers, resistors, wires and an LED matrix board. It also includes a link to a forum thread with additional information and examples of code to control the LED matrix.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 86

@ @ya@a@a@i

@ @@mba@@
Matrix Dot Led

/ 

@ @c@b@O
/   
@ @
@ @
< <<^<_<V<]<]<e]

  
 


     

 

!  #$
  " ! 
 /. +, -. )('
, 234 ' 0!, ', ,

 75
  
  0:. /, 0:.3
", 
3 / 03
.  #
   /, '() 0 
,  =< 
 <7 /, %1 3 -0+ 
" , 
,) .  'B.(('0
 E <, 0 ,
7   'B= 3
# /, led matrix2
 /$  0 B / "   '.
 + #3 !,
   #0R), '
, E Q
Q  U<' S
  < /,, , /7 V /7 led matrix

 <, 0 ,
 ,  0 7 /, :
  < /, /7 V  ',
 # #+Y 
'07  #Z  
3 .  [' ) micro c
"   /, 7
 
http://www.qariya.com/vb/showthread.php?t=40760&page=3
V0  '[ ' ,<0! / '+,  Y

t$ 
 $  <
  /0 #$  '0
< '0  '0
0 '00Z
"0' - <, , /7 V /7 
Y, ' , "7+"
 / .
 !3  Q 0:.0:.
  /.  /. #0R3!3  " ' , /,
 $
)<t
)< t

" [ <'+,

! -ZQ
$ 
 (33  
vR7 03 < '[ '+,)
 E '343 /, Q' 03  R 'w
y0, 5 ") 'Z /, Q $   ".( '0<x
 y0, 3   -0+Y  V0' (= t< 0x< 
  Y  "
, 
 /, Q  :
$  "    <=) , ,  (
________________________________________________
) Q < Q 

 ! /7 ',7

 /, - -0, -  !"  
 /7 /,2

 ' 3 < /,! Q) 
77777777777777
-<$<' 
  y B  5,3  -:, -0+3 
 
. Q) 
77777777777777
___________________________
3 < E Y, -  Q 'R0) #)( , . B
 ' , #0R) ., /, '

_______________________________-



   
<x +  'B Q  

U<R 7 Z  -0[Y) 
0 7 4:, 0
4 / 5 ,  Y 5 0  E - ' 7'
 #0+
   , 
,, B '7+,  "7  
7  #R$
w B  2 $  - ! .,  3 $
B :
   
 < /, '7+,   )"   t
 
,,
Y  /0   ) 0 , U<3,
'  7  4:, 2 $ 7  5  3$
  /.  4 #0R)  $ /0 )'<7
 4  /0 ,  Y  /0
B   

y /,'0:

 
 . " #, -     E  '  2$
) 0  /,'

   Y

 0

  0   /, B 7 . . 0 - #, /, '!(, -<' B


  -0=  /,0 "Z  #, = V0 t3
 
  Z .

:

void main()
{
TRISB=0;
PORTB=0;
loop:
PORTB=0B00000001;
PORTB=0B00000010;
PORTB=0B00000100;
PORTB=0B00001000;
PORTB=0B00010000;
PORTB=0B00100000;
PORTB=0B01000000;
PORTB=0B10000000;

delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);

goto loop;
}
( delay_ms(500 ' 0
,y    Z 3 0' + .
  

'0w 2
 
<B .( ! 3 /7 <7 
 3 . 3
Q  -.Y

/00 7)  0 -!3 /, ' RB /7 <7 


( """"".<+7, E![ E  y7 )Q E  Y  ' . 3 0$!
  <

Y, !  B 3

,
((<E ', )) y

<-  $ ,7

Z!  2, -0

MB0.03 - rar.
' +  4 3
' + /, B R  Z -,. R)
<- , 0 t ., - t) t  R$ 7   

 # 
) Q /0
 -.
 ,  Y' )'B

 B "0  


 (, 7 , t ., - <

 '07'   #R  7 tR ) t ., -!3 t0
 
).7 -( "  = -  / R  t3 :
 < 
$ -) t   t
3 4 0 B 3 + '!R
, $0 3 Z
#, )<  t 5 '  , ' E  =t ,+t , ) 
)<' . (  <= 5
 '<)
 ,40  " '0v". 
 

'!$


   / 
! 0 Y <)0

(3 
$ (,  /, B.0
  )( <    A
 . ) U 

:

void main()
{
TRISB=0;
PORTB=0;
loop:
PORTB=0B00000001;
PORTB=0B00000010;
PORTB=0B00000100;
PORTB=0B00001000;
PORTB=0B00010000;
PORTB=0B00100000;
PORTB=0B01000000;
PORTB=0B10000000;

delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);
delay_ms(500);

goto loop;
}

A ( 3 -0 !  B 3


."
:

void main()
{
TRISB=0;
PORTB=0;
TRISA=0;
PORTA=0;
loop:
PORTA=0B11110;
PORTB=0B00000001; delay_ms(500);
///////////
PORTA=0B11101;
PORTB=0B00000010;
/////////////
PORTA=0B11011;
PORTB=0B00000100;
////////////
PORTA=0B10111;
PORTB=0B00001000;
///////////
PORTA=0B01111;
PORTB=0B00010000;

delay_ms(500);

delay_ms(500);

delay_ms(500);

delay_ms(500);

goto loop;
}
'0  , - /0 -  " !///// ',4 
 4
00[ , 7   . : .  . /0 'B B ..,
'0
" ,  'RB 4
 , B a <, R7  0$ 4 R  
 
' ,' RB
!R
 w  $!     R
 w 0$   -   )

=<   B /


w ................................  ,
 .0  2  -
 U0<R
'RB' '07
 <   -

-,. 2

lesson_1.rar - 0.06MB
4,' : ',
 : 3 '+ + .  ,8
/, -!3)0  7/00

+  , <0 3 + "  , 5 B
  )<t
=<  )< t 7 (, < A.0, - f84a16 )(+  ',
 '0
" )<  t4  a and B /0

 
$! 5 B
t $   Y'
<, B  R R /, 0 ,

   2 $
3 .  <7 Q /7

" N

'EE 7

-:, 

@
@
@
@
@
@
@
@
@

@
@
@
@
@
@
@
@
@

) (

)4 .07' Q'


0 3  t   :  < / 0: /7 
 )  0 t7, " R (R
 -<$E -
 $ 0, Z /,Y +  ,=
3 /,Y
 $ 7 
3 Q BY"""""""""""

   
. -B    '
,"""""

 
$  
! 0
'RB'

/, /. < ) "0 <


0
3
R 
,0  -.Y

'EY ) $ /, -v, /7 <7 Y


'EY /00 7

0< . . )( ! 3 -.Y 0!

. - B 00[ B 3 

.
U) . 
:

:

void main()
{
TRISB=0;
PORTB=0;
TRISA=0;
PORTA=0;
loop:
PORTA=0B11110;
PORTB=0B00000001; delay_ms(500);
///////////
PORTA=0B11101;
PORTB=0B00000010;
/////////////
PORTA=0B11011;
PORTB=0B00000100;
////////////
PORTA=0B10111;
PORTB=0B00001000;
///////////
PORTA=0B01111;
PORTB=0B00010000;

delay_ms(500);

delay_ms(500);

delay_ms(500);

delay_ms(500);

goto loop;
}

('' )
 4 porta ( 3 
$ . -
   -0 ! B ' 7 /0 - <
7 $< 1'0B # "   0 '0B # 
'0) 3 ' EY 7 Y  , portb (3 
$
(data)

4  . ) U (delay_ms(500 ,


:

:

;)delay_ms(500


,, ms /0
  
  < '+,  /, 1000 /, 1 0$ 
 ms'0:
  
 /, /,'0:
# /, <  '+,
  0$ /, -$ ), 2(
  )(us
.  0$ /, 1000,000/,1'0:
  0, /, 1 
 0$ /,'0:
  !
 t.  <= 'BR 0[ /. m u
:

;)delay_us(500


 7 5  /0 ) #0R 03 Y, ,
 /, 1000/,1'0:
), "
. -0 ) t7 0, /,1 /,'0:
   3 "  'RB0
B7 3, 7 .     '07 -. .....................
,
 Y # Y  $, #   " B3 y0

Q  $    Q Q< 3
U<3  
 03
0$  B  3 00[   $, 0   $
+ . .0
:

void main()
{
TRISB=0;
PORTB=0;
TRISA=0;
PORTA=0;
loop:
PORTA=0B11110;
PORTB=0B00000001; delay_us(500);
///////////
PORTA=0B11101;
PORTB=0B00000010;
/////////////
PORTA=0B11011;
PORTB=0B00000100;
////////////
PORTA=0B10111;
PORTB=0B00001000;
///////////
PORTA=0B01111;
PORTB=0B00010000;

delay_us(500);

delay_us(500);

delay_us(500);

delay_us(500);

goto loop;
}

.( 3
( <3
7 Y 3
w -.E   $ 7  -!3 /, ' B

7  -!3 /, -, 

  

 ' < <E


 /0  ,/0

  ,/0
-!$  ((((((((((
______________________________________
 '
+B /7 UvB<
 
   [/0 , /0+), 0
/00"""""""""""""""""""
'" /
,  ,B 
) w<)  
 
,


07,
 /, -. 07 -   /0 E Q
4444444444444444444444444444444444444444
 ) 
 $ 7 , .$  $ 7   )U
' 3  -7 N E -:, Q 

) .Z  /.  20"  7'EY


  . ' (3 Z ! . 3   Q" 

 0  N

  -<$  (R   !"  < (R )'B


,   (R ) 'B

=<     
  '", a B ! -07
 b  ( 
 Y,  , /0
3 B
 #

y B /,.  (  , 



< B

:

;)PORTB=0B00000001; delay_us(500
;)PORTB=0B00000010; delay_us(500
;)PORTB=0B00000100; delay_us(500
;)PORTB=0B00001000; delay_us(500
;)PORTB=0B00010000; delay_us(500


  U0$ - . 3 Y , 'EE 7 5
07
 (  /, -v 7 -!3
 0 :y  -.Y
 , 3 /0 1$$ 0

00000001
00000010
00000100
00001000
00010000

   -.E( -v

 75
B [00   B  - $
 t Y 

   N
/, /. (  

$ -0.Y N   .0
01111110
00000100
00001000
00010000
01111110

N  + 3 U) -.Y 0

U) .( ! 3   


" E   00[ B #Z
: . .0
:

void main()
{
TRISB=0;
PORTB=0;
TRISA=0;
PORTA=0;
loop:
PORTA=0B11110;
PORTB=0B01111110; delay_us(500);
///////////
PORTA=0B11101;
PORTB=0B00000100;
/////////////
PORTA=0B11011;
PORTB=0B00001000;
////////////
PORTA=0B10111;
PORTB=0B00010000;
///////////
PORTA=0B01111;
PORTB=0B01111110;

delay_us(500);

delay_us(500);

delay_us(500);

delay_us(500);

goto loop;
}


0
us  3 0$  ms /, 0$ 00[  $ 
E U<3 


00[ 
$ Y ,) data  7 /0( 'EY

 [00  

 t   Y  -0[Y
3 Y  -.Y Q

<, .07

 0

B 
$  '.  0 .,

  # /, -. 
B  4   t(  
3,  '  -<
  t ., -.E0 ,
) B y  )  [Z w t . 7   /(
)"    !)' (
. 3 Y 'EE0  , -.Y Y

:'  ,  ! .0


http://www.4shared.com/file/17755886.../lesson_2.html

-0 y, 00[ $ $


5 0
0

 tR 5

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
N
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNN
Q E  B
<Y /, f84a16 . B B 3
/ 'B -0$ ' (, 7 + 0['
f877a16 . Q )(  3
' +( ' < , 7 :. 5

Q E  B
 3 . 3
< -.Y N  " 
' EE 7 5
 3
   

'0 , 7  

char
for
(wile(1
:. .0
 ' ' 0 
 
  5" ,(3 /,  ,' 7+, 7 -Y 
:

void main(){
char x;
TRISB=0; PORTB=0;
delay_ms(1000);
while(1){
for(x=0;x<9;x++){ PORTB++; delay_ms(1000);}
portb=0;delay_ms(1000);
}
}

:.  4 

+,"  ,
 )(, R , - .  B

.3 #,  .
Q  $    Q)

@ @
@ @
@ @

) (V:

)4 .07' Q'


 y0"+  0  V: Q

t  R70' #0+
  <$" /,3  03
)' v  '",
<
 
  '07  $(
 4  20
)
 5
. 4 y
,  UR V: #

   (03 -.Y :

 :
'  ' , .07 t+ , E  "0 )U
" /,  , <
 "07
(((((((((((((((((((((((((((((((((((((((((((((((((( (((((((((((((((
) Q /0
) /0 ) Q '07-

,<  #0+


  ,  .07
 ,7
  " 40$  ,
 )  Y  U<3 -<$ /,

  <3 '+, 

 $ .   : 7
) (char =<  )( ), y+'    .0  "0R 3
)'  $ 
 3  
 0[, "3
 /, /. B
[00  Y  . $
:,:
char n char m; char x
) (for () , ',  B <7 /0 , , 5 /, /0 ,
:, :
:

)for(x=0;x<9;x++


 B7  9
(while(1
:

)while(1

 ,  0 < 5 ," 3


 < :loop -:,   "  . goto loop 
 "  .
)()()()()()()()()()()()()()()()()()()()()()()(
 .0   x <  , f877a16 B' f84a16 0

y   ,  .0


http://hobby_elec.piclist.com/e_pic6_h04.htm

 Y 7 ( 0:

 )( ( a B
3 )( 0 < B)< < < A f877a16  D

 (, 8 
0R (, 8 +
 
., B  '. -.Y N< B :

 <E E .
, E  
) 
00   '0,  (((((((((

 4 U  '0B 


 7Q

E=/

 .0. +
 [00
 U<3, -:, DE
   - A

3 + . < <  3 ,  !  7  -

 .0.:
:

)(void main
{
;TRISB=0
;PORTB=0
;TRISd=0
;PORTd=0
loop:
;PORTd=0B11111110
;)PORTB=0B11111111; delay_us(300
///////////
;PORTd=0B11111101
;)PORTB=0B11111111; delay_us(300
/////////////

PORTd=0B11111011;
PORTB=0B00000110; delay_us(300);
////////////
PORTd=0B11110111;
PORTB=0B00001000; delay_us(300);
///////////
PORTd=0B11101111;
PORTB=0B00010000; delay_us(300);
///////////////////
PORTd=0B11011111;
PORTB=0B00110000; delay_us(300);
////////////
PORTd=0B10111111;
PORTB=0B11111111; delay_us(300);
///////////
PORTd=0B01111111;
PORTB=0B11111111; delay_us(300);

goto loop;
}

 < < """""""3 /, -   ,<  .0

 .0 Z 7 .0 3   ',4  "0 ",


(LVE_OFF(0 )

 ,  . .+

HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

 
t

  0 /Y

 t
0E '0+

 B  -0 
t(0
led matrix for animation #, t

 -<$ /. 
  7  U<3  ' 3 
 5! D E B (3 
,<
Y,  7 /0 'EY   DATA B(3 
,

'7 ,
0B11111111
0B11111111
0B00000110
0B00001000
0B00010000
0B00110000
0B11111111
0B11111111

'EY 7  ", -0 $ B 4 


"
7 '
 U<3  ,  3 
v .    ., y+ -<$ /, 
$  char  ,"
void main ' -<$ .
7 8 

 
/, 8 y+   3
'!(,  <= 3" 0R  3
,< 7  + 3 .
:

char
char
char
char
char
char
char
char

x1=0B11111111;
x2=0B11111111;
x3=0B00000110;
x4=0B00001000;
x5=0B00010000;
x6=0B00110000;
x7=0B11111111;
x8=0B11111111;

0,  Y 


, -.Y ! t0  
! #' 
' B)' + 0  3
0[( 3 #, /.
: . .0
:

char
char
char
char
char
char
char
char

x1=0B11111111;
x2=0B11111111;
x3=0B00000110;
x4=0B00001000;
x5=0B00010000;
x6=0B00110000;
x7=0B11111111;
x8=0B11111111;

char n;

void main()
{
TRISB=0;
PORTB=0;
TRISd=0;
PORTd=0;
loop:
PORTd=0B11111110;
PORTB=x1; delay_us(300);
///////////
PORTd=0B11111101;
PORTB=x2; delay_us(300);
/////////////
PORTd=0B11111011;
PORTB=x3; delay_us(300);
////////////
PORTd=0B11110111;
PORTB=x4; delay_us(300);
///////////
PORTd=0B11101111;
PORTB=x5; delay_us(300);
///////////////////
PORTd=0B11011111;
PORTB=x6; delay_us(300);
////////////
PORTd=0B10111111;
PORTB=x7; delay_us(300);
///////////
PORTd=0B01111111;
PORTB=x8; delay_us(300);

goto loop;
}

'B)' +0
 ! Y 3 . # $


  ! ,(3 /.
%%%%%%%%%%%%%%%%%%%%%%char
 5
 B=  '0 R(   -B
 3
for  ,
/., 7  , 7 ,< B . for ,( 3 B 3
Q E  , 100 4:, 100 (

: . .0
:

char
char
char
char
char
char
char
char

x1=0B11111111;
x2=0B11111111;
x3=0B00000110;
x4=0B00001000;
x5=0B00010000;
x6=0B00110000;
x7=0B11111111;
x8=0B11111111;

char n;
void main()
{
TRISB=0;
PORTB=0;
TRISd=0;
PORTd=0;
loop:
for(n=0;n<100;n++){

PORTd=0B11111110;
PORTB=x1; delay_us(300);
///////////
PORTd=0B11111101;
PORTB=x2; delay_us(300);
/////////////
PORTd=0B11111011;
PORTB=x3; delay_us(300);
////////////
PORTd=0B11110111;
PORTB=x4; delay_us(300);
///////////
PORTd=0B11101111;
PORTB=x5; delay_us(300);
///////////////////
PORTd=0B11011111;
PORTB=x6; delay_us(300);
////////////
PORTd=0B10111111;
PORTB=x7; delay_us(300);
///////////
PORTd=0B01111111;
PORTB=x8; delay_us(300);

}
goto loop;
}

 "2, ! 7  <= .( 3

,
,
=<  + '  E
 /. -

  4

NNNNNNNNNNNNMMMMMMMMMMMMMMMMNNNNNNNNNN

 =<  

 

 R /, /0R( 
$  #.  ...................

(R " ', R "03 !

  ,   x1 - +  ., t x2


. .  ., 1  2., 2  3., 4  4 .
.

ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
  

  0  ({ ) ',4

 '" v , "' <,


 Y  -. )  U -!3.  !  ., ',4 /0,
, goto loop -<$

,  
    "' <-,. ,
t -<$,

  

3  #Z )

'03 t
x1=x2
x2=x3
x3=x4
x4=x5
x5=x6
x6=x7
x7=x8
x8=x1

  '

B7 '
  "  ,
, 

,
 
 7 '7 , 00[ 
$'EY
 /. "., 0[,
 , 
$,    7   !)"
 .0. 
"v
::::::::::::::::::::::::::::

:

char
char
char
char
char
char
char
char

x1=0B11111111;
x2=0B11111111;
x3=0B00000110;
x4=0B00001000;
x5=0B00010000;
x6=0B00110000;
x7=0B11111111;
x8=0B11111111;

char n;
void main()
{
TRISB=0;
PORTB=0;
TRISd=0;
PORTd=0;
loop:
for(n=0;n<100;n++){

PORTd=0B11111110;
PORTB=x1; delay_us(300);
///////////
PORTd=0B11111101;
PORTB=x2; delay_us(300);
/////////////
PORTd=0B11111011;
PORTB=x3; delay_us(300);
////////////
PORTd=0B11110111;
PORTB=x4; delay_us(300);
///////////
PORTd=0B11101111;
PORTB=x5; delay_us(300);
///////////////////
PORTd=0B11011111;
PORTB=x6; delay_us(300);
////////////
PORTd=0B10111111;
PORTB=x7; delay_us(300);
///////////
PORTd=0B01111111;
PORTB=x8; delay_us(300);
}
x1=x2;
////
  
x2=x3;
x3=x4;
x4=x5;
x5=x6;
x6=x7;
x7=x8;
x8=x1;
/////  
goto loop;
}

N  5  $ #0+ 7 <,

3 +  /, -!3 4:, 7


B 
07,   #, 7
(  /0 5( )"    !)'  
  #!
http://www.4shared.com/file/17915016...b/lesson3.html
  Q!, #  V:

 /,  /0
B  /,'  # 2'<R / 2
"
   #, ! #$)  /0 !  "Z
' 

" ,, #$+@ @


@ @

4,'  7 ', V:


3 4  
 0x
'<<3'   -

3, '    -7 '0!0 /0 - 

B7 !' .070 """""""""""" '  <


,7<, 2 Y,  

 #, . " .y    $ E #, Y =<#

) Q   $  Q
 
  , 7E - $
"  '   <3 5
 /,/0
)  (

    


   
  !  "#
 , ** %&#' '  ()#
NNNNNNNNNN

  * 87   5) , /34&,  1 1/)0 (! ) ,


 / ,   8 %&#  ' %*(
7 )  0 *<8  ; ' &: '
) * )  &) 3
MMMMMMMMMMMMnasserMMMMMMMMMMMMMM
8 ,#*HI , % *H5 ' "G  ) ,: J N3
7 *H5  8"  :3
*3
8 ,# % ,  N3 '<* char '<* )S  ) Q 
 
  , N3 7 <* :
*:

;x1=0B11111111
;x2=0B11111111
;x3=0B00000110
;x4=0B00001000
;x5=0B00010000
;x6=0B00110000
;x7=0B11111111
;x8=0B11111111

) H  "H') #   ( ) ( )3Q (V,

*#  "H #0) I03Q ( V,

char
char
char
char
char
char
char
char

7 * 3Q  V, Q   "X3 N


x1=0B11111111
x2=0B11111111
x3=0B00000110
x4=0B00001000
x5=0B00010000
x6=0B00110000
x7=0B11111111
x8=0B11111111

char
char
shar
char
char
char
char
char

   ! f  8H#0 ' g8 1


7 8 !*3 0 8
,   < i  3 0 3 ! ' "XX3 ) ()53

);(
;   , g<3 '  8    j
7 *# *3 8 H# 8j  , *# *3 '; 0
char x9=0B00000000
; *X  H# 81 )S 9
 
*8 */ mm    8< )g
 ,)*# g/ 7I3; :*' H# H7 &:
7 *# )3  ))
5) ,)< 8 X88 8  3 ,,*
" '  ',

'

,m & X 7


; 7I3 *# g/) , char *< ' 8  mQ* / *#
/&#' : S)'
", o ) S)* X0 3 < * j* 0* / *#
0 ,"  <G0 (((< f( )))' m&   < 4
:  *
:*

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

x1=0b00000000;
x2=0b00000000;
x3=0b11111110;
x4=0b11111110;
x5=0b00000000; ////
x6=0b11111110;
x7=0b11111110;
x8=0b00000110;
x9=0b00000110;
x10=0b11111110;
x11=0b11111110;
x12=0b00000110;
x13=0b00000110;
x14=0b00111110;
x15=0b00101110;
x16=0b00101000;
x17=0b00111000;
x18=0b00000000; ////
x19=0b00000000;
x20=0b00000000;
x21=0b00000000;

char n;
void main()
{
TRISB=0;
PORTB=0;
TRISd=0;
PORTd=0;
loop:
for(n=0;n<100;n++){

PORTd=0B11111110;
PORTB=x1; delay_us(300);
///////////
PORTd=0B11111101;
PORTB=x2; delay_us(300);
/////////////
PORTd=0B11111011;
PORTB=x3; delay_us(300);
////////////

PORTd=0B11110111;
PORTB=x4; delay_us(300);
///////////
PORTd=0B11101111;
PORTB=x5; delay_us(300);
///////////////////
PORTd=0B11011111;
PORTB=x6; delay_us(300);
////////////
PORTd=0B10111111;
PORTB=x7; delay_us(300);
///////////
PORTd=0B01111111;
PORTB=x8; delay_us(300);

x1=x2;
x2=x3;
x3=x4;
x4=x5;
x5=x6;
x6=x7;
x7=x8;
x8=x9;
x9=x10;
x10=x11;
x11=x12;
x12=x13;
x13=x14;
x14=x15;
x15=x16;
x16=x17;
x17=x18;
x18=x19;
x19=x20;
x20=x21;
x21=x1;

goto loop;
}

 < ) '   f(  ! Q *#

7 )  3*#

)))))))))))))' *' *((((((((((((((


 5) , )3Q ( V,  * ) 3 H#100
 p ,(:*3 
0000 00000000000000000110000000000001100000000000000000
0000 00000000000000000111100000000001100000000000000000
0000 00000000000000000110011000000001100000000000000000
0000 00000000000000000110000110000001100000000000000000
0000 00000000000000000110000001100001100000000000000000
0000 00000000000000000110000000011001100000000000000000
0000 00000000000000000110000000000111100000000000000000
0000 00000000000000000110000000000001100000000000000000
;X3# *  *
)3    * I0

',' ,
  .7  )
 ( (( ).7 ))
/00)  0 /,  0
 7
)0  /00 /,  <  3   .7  

:*

PORTd=0B11111110;
PORTB=x1; delay_us(300);
///////////
PORTd=0B11111101;
PORTB=x2; delay_us(300);
/////////////
PORTd=0B11111011;
PORTB=x3; delay_us(300);
////////////
PORTd=0B11110111;
PORTB=x4; delay_us(300);
///////////
PORTd=0B11101111;
PORTB=x5; delay_us(300);
///////////////////
PORTd=0B11011111;
PORTB=x6; delay_us(300);
////////////
PORTd=0B10111111;
PORTB=x7; delay_us(300);
///////////
PORTd=0B01111111;
PORTB=x8; delay_us(300);

: 7 1  * 7
:*

PORTd=0B11111110;
PORTB=x8; delay_us(300);
///////////
PORTd=0B11111101;
PORTB=x7; delay_us(300);
/////////////
PORTd=0B11111011;
PORTB=x6; delay_us(300);
////////////
PORTd=0B11110111;
PORTB=x5; delay_us(300);
///////////
PORTd=0B11101111;
PORTB=x4; delay_us(300);
///////////////////
PORTd=0B11011111;

;)PORTB=x3; delay_us(300
////////////
;PORTd=0B10111111
;)PORTB=x2; delay_us(300
///////////
;PORTd=0B01111111
;)PORTB=x1; delay_us(300

 0 ) )"' 5


)3 8j m  3Q V,
 )3 ( 1
 X )g/
I g<3 *3 I )3 :) :*' 7I3 / :

)3  0  ' 0 
*
*
*
0  )
 ' !" u*, 0 *'*/ )< )#

 o*  '  


  

 3 8 
((Q E  B))  
* 'HI /) *#
 7 
5)
HC16474 Shift register
0 <; 3'
f84a16 '8 A( *G* */3 () G 7
f877a16  '8 D (G* N3* /3 *#
 0 ,  V: )(G* * #  , 

* 8 )  0 * '<;

 5(( data sheet )) ( N3


http://tw.ic-on-line.cn/IOL_74HC164/PdfView/1032173.htm

&; """"""""""""""": ' ,,<' 


 '  ' o*  8  ) *j* 7 m
http://www.qariya.com/vb/showthread.php?t=50565


,'  3 8

/0 /, 
 5<3  ' 

) (1'5
    
   
*I0 'u u N0
 ) ) 8< *HI *HI
 0  u(/*) 0 ) 3  */ ) ;I#0 "N  8""""""""
  8 3*# , ,#%
 '   5)# '  /8
*/  ; '   1 
&m X  o  '

0    ) )


777777777777777777777777777777777777777777777
* m   * 8 , ,#) % *HI '
) / ' i) N3
 )3,S)#0  */ 78,'8 )& ;3 0  * I0   3
)& ; 7  5' 2 /8
55555555555555555555555555555555
:
  7 * '3  5)# '< 0
*#  ' * ", m 
hc16474

hc59574
*# ) 5 0
0 ' I  )& &, '

7 * '<; 0  Q ! 


   *' ,  3
vcc) ' / "8 8 4 V5 ) 37S*! g #
GndH  g v0 #
8 !*3!; Q #
7  '5 0 #
B&A # 84 !*3
37 "#*I   )( data
4 CLK7  N&, 
4 !*3 CLR #7 ; 1( ; 3 o3 

'
'("* 8 *' 0

*# 7 g0 )     m 
) '  &4 ;I)37S
* )3; * 5  4 1
 ' ;3 8 A ;I/# ,#
555555555555555555555555555555555555555555555
5* H CLR
7"8 *8 o*8 g# 7I */3   ;SQ0 3 ! ' #
*# i7  4 H m&' V5
5 ' ,"""""""""""
66 66666666666666666666666666666666666666666666666666
,3  /&30 5' 3 m 
clk&B&A
*# ) 3 ' N3B&A 8H
*# " '  H I   8*)
8 gp0Q * V * F1 ....... 1
33333333333333333333333333333333333333333
7 g0  H CLK I0
*   7 N&, 
*# */ *  *) 8 (0
7777777777777777777777777777777777
) / '3 0 m %&#)  * .....................

_________________________________
__________________________________
% * 5)   * 0* / *#
% )<  * 1( 8
:*

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

x1=0b00000000;
x2=0b00000000;
x3=0b11111110;
x4=0b11111110;
x5=0b00000000; ////
x6=0b11111110;
x7=0b11111110;
x8=0b00000110;
x9=0b00000110;
x10=0b11111110;
x11=0b11111110;
x12=0b00000110;
x13=0b00000110;
x14=0b00111110;
x15=0b00101110;
x16=0b00101000;
x17=0b00111000;
x18=0b00000000; ////
x19=0b00000000;
x20=0b00000000;
x21=0b00000000;

char n;
void main()
{
TRISB=0;
PORTB=0;
TRISd=0;
PORTd=0;
loop:

for(n=0;n<100;n++){

PORTd=0B11111110;
PORTB=x1; delay_us(300);
///////////
PORTd=0B11111101;
PORTB=x2; delay_us(300);
/////////////
PORTd=0B11111011;
PORTB=x3; delay_us(300);
////////////
PORTd=0B11110111;
PORTB=x4; delay_us(300);
///////////
PORTd=0B11101111;
PORTB=x5; delay_us(300);
///////////////////
PORTd=0B11011111;
PORTB=x6; delay_us(300);
////////////
PORTd=0B10111111;
PORTB=x7; delay_us(300);
///////////
PORTd=0B01111111;
PORTB=x8; delay_us(300);

x1=x2;
x2=x3;
x3=x4;
x4=x5;
x5=x6;
x6=x7;
x7=x8;
x8=x9;
x9=x10;
x10=x11;
x11=x12;
x12=x13;
x13=x14;
x14=x15;
x15=x16;

;x16=x17
;x17=x18
;x18=x19
;x19=x20
;x20=x21
;x21=x1

;goto loop
}

;&: j* < 3


*# Q  ! "' )H/
==========================
*   ,( ) '; ' '< 0
*8 < ;  /8 7 
)    /H,' 1( /H,'0

7
   0/1

 < *j
/H,' "H  )8 ) /H,' p""""""""""""""""""
': ,

)& *'0
*:  & 3 m 4

' I   B&A) , &* 1  


' ,  ,
 ;  3u  ,  0
 *8 ;    H&* ); " 7 '0

porta.f1=1; porta.f1=0
 *   ') &* F1< 1 :
7 * I ' ,*H5 0
*/  7 '0
*:

;porta.f0=0

;porta.f0=1;porta.f1=1; porta.f1=0

7 , 3 '0 )( ,: ,  )8N&,


J ,/p  ,/pN&,
) ,  u
)( ,:  '  8 N&, o:

J,/p..................................

)* )8 ,  ,/p )8 ,I0 ,/p (


 3 m
 , <;  )3
g<3 )8 )3 8 ,J0 o:
"/p J
V
V
V
 /)3 0 *HI #  '0
' *HI , '
  8 ;<' ; 30 * '5! ';  g!*' H
 , VH7 '0
*# < &* 0 <; 0 & *) g# (*)3 8
_____________________
7 (" '00 7 <* 0' "
'0*HI , ' I0 '

H ,: '0 ;' ) ))' ' I07

*:

;porta.f0=0
;porta.f0=0

;porta.f0=1;porta.f1=1; porta.f1=0
;porta.f0=1;porta.f1=1; porta.f1=0

*# < '<; 0 / : ' *HI


 ,H' 3 '0 *# *HI3 /)3 7

   &4 5 <; 0 5' 8 Q


*  ,H'8 '0 *# < &* : I0* H
 , <;  *HI 8 '
7  'm 
' 7  "( H/, , ;<' 2 ,' 5)#
 I 16 ,
*8 )  16 '


 !)# 'm ' %&# Q 7 ' ,"""""""""""""

7 :
4 ' /34 ,  : ) '; ' '<; 0
4 !*3  &4 ')5 
 7  /3H &) ' V  ' ;&:

*3 :

 * 0  
 ;&: ' ,"8
 "G0 * ' m 1
*/ ,8 "G  
' 4 g#
' '5 * 8 A*)
7 * '3 &X '  5)# 1 '<; 0
 "X  7*H5 g   7  3
H  J)* ' 3' o:

portb=0b10101010
porta.f0=1;porta.f1=1 porta.f1=0; porta.f0=0
porta.f0=1;porta.f1=1; porta.f1=0 porta.f0=0

) / o"8 : &p0
7 '0
*# N3  * ' 2 :1


'0*  HI ,' / ,0


%&# * )( ;   /  *3  8 &  4 , 0
====================================
: 3 <  * 0

:*

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

x1=0b00000000;
x2=0b00000000;
x3=0b11111110;
x4=0b11111110;
x5=0b00000000; ////
x6=0b11111110;
x7=0b11111110;
x8=0b00000110;
x9=0b00000110;
x10=0b11111110;
x11=0b11111110;
x12=0b00000110;
x13=0b00000110;
x14=0b00111110;
x15=0b00101110;
x16=0b00101000;
x17=0b00111000;
x18=0b00000000; ////
x19=0b00000000;
x20=0b00000000;
x21=0b00000000;

char n;
void main()
{
TRISB=0;
PORTB=0;
TRISa=0;
PORTa=0;
loop:
for(n=0;n<100;n++){
porta.f1=1;

porta.f1=0;/////////*****///////////

//////////////////////////////////////////////

porta.f0=1;porta.f1=1; porta.f1=0;
portb=x1;
delay_us(300);

porta.f0=0;

//////////////////////////////////////////////
porta.f0=1;porta.f1=1; porta.f1=0;
portb=x2;
delay_us(300);

porta.f0=0;

//////////////////////////////////////////////
porta.f0=1;porta.f1=1; porta.f1=0;
portb=x3;
delay_us(300);

porta.f0=0;

//////////////////////////////////////////////
porta.f0=1;porta.f1=1; porta.f1=0;
portb=x4;
delay_us(300);

porta.f0=0;

//////////////////////////////////////////////
porta.f0=1;porta.f1=1; porta.f1=0;
portb=x5;
delay_us(300);

porta.f0=0;

//////////////////////////////////////////////

porta.f0=1;porta.f1=1; porta.f1=0;
portb=x6;
delay_us(300);

porta.f0=0;

//////////////////////////////////////////////
porta.f0=1;porta.f1=1; porta.f1=0; porta.f0=0;
portb=x7;
delay_us(300);
//////////////////////////////////////////////
porta.f0=1;porta.f1=1; porta.f1=0; porta.f0=0;
portb=x8;
delay_us(300);

x1=x2;
x2=x3;
x3=x4;
x4=x5;
x5=x6;
x6=x7;
x7=x8;
x8=x9;
x9=x10;
x10=x11;
x11=x12;
x12=x13;

;x13=x14
;x14=x15
;x15=x16
;x16=x17
;x17=x18
;x18=x19
;x19=x20
;x20=x21
;x21=x1

;goto loop
}

 ) / : ' S  *3


/8 &), '  , * , *& D A
 0 * ' "3

 8 f* *) ,: ,;


;<' 2
7  )  3*#( *; <'0  "N&

)37 )*; 0  ' <

5555555555555555555555555555555555555555555555

nnnnnnnnnnnnnnnnnnnnnnn
) / * ! #
p ' * """"""""
 i7 )) *, ' )

*, 0 m Q 7 ',

/ :' V  ,


) )*g

0   ) ' !"u

" 0 0&# o i ' o,X


&#   &#   X
) )(

    

   

  ! 
 , **  5 8"8
::::::::::::::::::::::::::::
u !  "8""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""
 : 3*# ,   *Q' 8 * ) '; ' led matrix 1
8 3*# ,  : /
 , )3 ' 1';   /8
 ,,3 ! ' ' 8*' 1 '  '
  ) ,/ ) '; ' 3u
;<' )I0 hc16474
 ,:   ; ' 8 x88 ;')' 1 ,#.1'5
)))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))))))))
* m   7   g  '%&#
*# ,, )* ' : # 5)#' ,; ' 8 %&# 1'5
*# )&  x88 1 'x328 13
8  H* 8 ,#( "G !  S  ) '   
 S ! "X ;:) 3u<0 '  &4  
7 ,
*  , u(: 7(/ 0 8  3#**j
+++++++++++++++++++++++++++++++++++++++++

 7 *  )*/8 j
( *; <' ' 1 0 
*/'  &H )*  * '*j
*/ ) ' 3 1)5 "#()0  * j/  &   "N
&

) / !   3  i

)))))))))))))))))))))((((((((((((((((((((((((((((( ((((((((((
*' 7 * g) o: &
)'   '  ,) * (55555555555I

*'  / )H

  8 f* ,  "  1( H;Q

* u! I ' ( f< )


7 0  &4 o' 5)#*  %* * 7 ! 
<u 0#  &  *HI 8 <; 0 *H5 ,  ,
*HI ' 3.............................. 8 300
______________________________________

7 ,I ,#< 3   Q S


 
)* j
  ! &),  /'
*# 0 */ )< Vu*  % 3!u

:
<u 0
 *
* &    ) *# Q) "#     (mQ
<u 0#
* '<* 0' 5 *
8 ,#) ,: (5) : *HI 8 ' .................... 0

<u ' I0*


:,H ) #)& (;3
' , ; '))3 S &:' :*' 7I3 '  g' g
55555555555555555555555555555555555555555555555555
) /  "8 : ,N0 8 !u *#  ; * '

 
*#  ; /8 8<u 0#
0 'Q ,* * x3287 ' , oJ 8 : < 3* 32
* ') *HI 8< ,
7 ("   , , *# x328 )  *HI 32 '
5555555555555I

3 8 8 *' 0 ,


)))))))))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))))))))))
*' 0  * 32 ,3
' ,  ' 3u  ) (
 ;   32 ) 
*# */ ) # * *# *HI 32 N)3 '

 *j&; :
; 3 * &' 3* )o:
  **m&' *3 ( '
); """""""""""""""8  * ' 0 )
3* ' )g& /) H& )3 3* )f
http://www.youtube.com/watch?v=XKaEDeQ4GEE

 *0

:*

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

d0=0b00000000;
d1=0b00000000;
d2=0b11111110;
d3=0b11111110;
d4=0b00000000; ////
d5=0b11111110;
d6=0b11111110;
d7=0b00000110;
d8=0b00000110;
d9=0b11111110;
d10=0b11111110;
d11=0b00000110;
d12=0b00000110;
d13=0b00111110;
d14=0b00101110;
d15=0b00101000;
d16=0b00011000;
d17=0b00000000; ////
d18=0b00000000;
d19=0b00000000;
d20=0b00000000;
d21=0b11111111;
d22=0b11111111;
d23=0b00000110;
d24=0b00111000;
d25=0b01100000;
d26=0b11111111;
d27=0b11111111;

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

d28=0b00000000;
d29=0b00000000;
d30=0b00010000;
d31=0b00111000;
d32=0b01111100;
d33=0b11111110;
d34=0b00111000;
d35=0b00111000; ////
d36=0b00111000;
d37=0b00111000;
d38=0b00111000;
d39=0b11111110;
d40=0b11101110;
d41=0b11000110;
d42=0b10000010;
d43=0b10000010;
d44=0b00000000;
d45=0b00000000;

char x;
void main() {
TRISA=0;
TRISB=0;
portb=0;
porta=0;
loop:
for (x=0;x<32;x++)
{
porta.f2=1;
////////////////////////////////////////
porta.f1=1;
porta.f1=0;

portb=d45; delay_us(250);
////
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d44; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d43; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d42; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d41; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d40; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d39; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d38; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d37; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d36;

delay_us(250);

porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d35; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d34; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d33; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d32; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d31; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d30; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d29; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d28; delay_us(250);
////
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d27; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d26; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d25; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d24; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d23; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d22; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d21; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d20; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d19;

delay_us(250);

porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d18; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d17; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d16; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d15; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d14; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d13; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portb=d12; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

}
d0=d1;
d1=d2;
d2=d3;
d3=d4;
d4=d5;
d5=d6;
d6=d7;
d7=d8;
d8=d9;
d9=d10;
d10=d11;
d11=d12;
d12=d13;
d13=d14;
d14=d15;
d15=d16;
d16=d17;
d17=d18;
d18=d19;
d19=d20;
d20=d21;
d21=d22;
d22=d23;
d23=d24;
d24=d25;
d25=d26;
d26=d27;
d27=d28;
d28=d29;
d29=d30;
d30=d31;
d31=d32;
d32=d33;
d33=d34;
d34=d35;
d35=d36;
d36=d37;
d37=d38;
d38=d39;
d39=d40;
d40=d41;

;d41=d42
;d42=d43
;d43=d44
;d44=d45
;d45=d0
;goto loop
}

' 8 ,7 *


  )*  * 45
;Q3 ))( f< ((  J  "# J N
; 7 )3 '   

'X

7),8 ! 
 )& 8 ;3<0
' <' 0  gI  
*8 o *HI = ' H# 
8 *# * '   
 o *HI = ' H# I 
1 8

 , * 7  H/,j
 "0)  "8
*# ) 5 8  ' ,0 ,#/' m 

++++++++++++++++++++++++++++++++++++++++
* ,8 0  *

* :  o7 * ' ' %&#0*


S < 8  8# * /8

(80*  /) , *HI ' ;# J


) ,8 *HI 8
,0  8 ;' ) ;&: ' , 8
' * * 32,3 8
*H5  o: * i7 *# <  *HI 32
7  *H5 I0  ;&#
*:

;porta.f0=0

;)portb=d12; delay_us(250
;porta.f0=1;porta.f1=1; porta.f1=0

*# < N3  3 ) ( delay_us )8 X)0 ;&: ' ;:


7 /8  # ' 3u,  10

8   o  H o: *3 &' #


7  8j0  ' 0 *!* 8 ;(# * loop
*!* 8' *8 for

 *   H  1

3 8  8 ! 5555555555555I


3 o3 ,"(3 ! "8

===================================
==============================

========================

0  7 *  ,#*
 'Q * *#   !   j* o:* *j 8  *j
)* """"""""""""

==================
) / 7  3)  o:& "N
 i7 )

 g  0 N3 ) V

 
 ' !"u
'
)  *8 & :""""""""""

') 8 3


&#   &#   X

))) )(((#

)4 .07' Q'


) Q /0

 .00  Q )#

 . $ #0+ t73 )'B


   'BR -<
 R R
 ) #0R    V:  7  :


  Q   #, -,
 7 x328

,  ) #0R .
, - y  7 7 
 '!$ / )'  .0 )( .....................................

 $
 B .  7"""""""""""""""""

3 B (! 0 B


B . . Y '

3 B 0 E Q
Y ,
x1616
7 S
,  R3 R3 16
7 7 7 16
)) 0 ((0
7  ,  B. ), 4+), "
7 '
, " R3  ( /,.0
 B7 
 'RB   0 /, : """"""""""""""""""""

 .0  0


 " 40 /,.0
 4+), ' B7 "  'RB
,40  B7 " ',"!,

  )   'B   /0) 4+), '


 .0

7  .  40  R


B7 "  /0:.
 /.  "   /

. . Y 
40 ',"!,:

3 B (3 ! . ) " U 


  
!, .0  )#

http://www.herosh.com/download/20952...son_7.rar.html

))))))!7 3  5[Z (((((((( nasser56


0 .0  

http://www.youtube.com/watch?v=7sGMXRSTVzU

4,' !0 R )< , t 'EY

 t7) . 
" 
073
    )'B

 ,$ :
. /, 
<,
3 y
 ) Y,  /0 '7 ( 'EY
y+ 3
   ..
 
  < /, 7.
 
3  /, /00 )0
 /, 7 $ )  /,)0  /00

,
B7 '
 < $ " 0 -<$  -.Y

 4
0 (3 
$ + , /0
/,)0 /00 /,)0  /00
(3 
$

'  -") ., . 

+++++++++++++++++++++++


 '<3 /, /. - !)" )(  ", B
 !)" )(  ", D

 /.  
0R   5' [00
 :5
Y 
$ 

 M 3

(3
, #,< D
==========================
==========================
=========================
   'RB 
30  4,'
( 

 3 .
:

;porta.f0=0

;porta.f0=1;porta.f1=1; porta.f1=0
;portd=m1

portb=d44; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

4 3
d44=B 
D=m1 

"
  -

===========

. /, -!3 y+ 


) '
(((. 5 ))) -  <0
v"
 . .0
:

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

d0=0b00000000;
d1=0b00000000;
d2=0b11111110;
d3=0b11111110;
d4=0b00000000; ////
d5=0b11111110;
d6=0b11111110;
d7=0b00000110;
d8=0b00000110;
d9=0b11111110;
d10=0b11111110;
d11=0b00000110;
d12=0b00000110;
d13=0b00111110;
d14=0b00101110;
d15=0b00101000;
d16=0b00011000;
d17=0b00000000; ////
d18=0b00000000;
d19=0b00000000;
d20=0b00000000;
d21=0b11111111;
d22=0b11111111;
d23=0b00000110;
d24=0b00111000;
d25=0b01100000;
d26=0b11111111;
d27=0b11111111;

   

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

d28=0b00000000;
d29=0b00000000;
d30=0b00010000;
d31=0b00111000;
d32=0b01111100;
d33=0b11111110;
d34=0b00111000;
d35=0b00111000; ////
d36=0b00111000;
d37=0b00111000;
d38=0b00111000;
d39=0b11111110;
d40=0b11101110;
d41=0b11000110;
d42=0b10000010;
d43=0b10000010;
d44=0b00000000;
d45=0b00000000;
m0=0b00000000;
m1=0b00000000;
m2=0b11111110;
m3=0b11111110;
m4=0b00000000; ////
m5=0b11111110;
m6=0b11111110;
m7=0b00000110;
m8=0b00000110;
m9=0b11111110;
m10=0b11111110;
m11=0b00000110;
m12=0b00000110;
m13=0b00111110;
m14=0b00101110;
m15=0b00101000;
m16=0b00011000;
m17=0b00000000; ////
m18=0b00000000;
m19=0b00000000;
m20=0b00000000;
m21=0b11111111;
m22=0b11111111;
m23=0b00000110;
m24=0b00111000;
m25=0b01100000;
m26=0b11111111;
m27=0b11111111;
m28=0b00000000;
m29=0b00000000;
m30=0b00010000;
m31=0b00111000;
m32=0b01111100;
m33=0b11111110;
m34=0b00111000;
m35=0b00111000; ////
m36=0b00111000;
m37=0b00111000;
m38=0b00111000;
m39=0b11111110;
m40=0b11101110;
m41=0b11000110;
m42=0b10000010;
m43=0b10000010;
m44=0b00000000;
m45=0b00000000;

/////////////////////////////////

char x;
void main() {
TRISA=0;
TRISB=0;
portb=0;
porta=0;
TRISd=0;
portd=0;
loop:
for (x=0;x<32;x++)
{
porta.f2=1;
////////////////////////////////////////
porta.f1=1;
porta.f1=0;
portd=m0;
portb=d45;
delay_us(250);
////
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m1;
portb=d44; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m2;
portb=d43; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m3;
portb=d42; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m4;
portb=d41; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m5;
portb=d40; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m6;
portb=d39; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m7;
portb=d38; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m8;
portb=d37; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m9;
portb=d36;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

delay_us(250);

porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m10;
portb=d35; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m11;
portb=d34; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m12;
portb=d33; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m13;
portb=d32; delay_us(250);

porta.f0=0;

porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m14;
portb=d31; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m15;
portb=d30; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m16;
portb=d29; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m17;
portb=d28; delay_us(250);
////
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m18;
portb=d27; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m19;
portb=d26; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m20;
portb=d25; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m21;
portb=d24; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m22;
portb=d23; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m23;
portb=d22; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m24;
portb=d21; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m25;
portb=d20; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m26;
portb=d19;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

porta.f0=0;

delay_us(250);

porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m27;
portb=d18; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m28;
portb=d17; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m29;
portb=d16; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;
portd=m30;
portb=d15; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

porta.f0=0;

portd=m31;
portb=d14; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m32;
portb=d13; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

portd=m33;
portb=d12; delay_us(250);
porta.f0=1;porta.f1=1; porta.f1=0;

porta.f0=0;

}
m0=m1;
m1=m2;
m2=m3;
m3=m4;
m4=m5;
m5=m6;
m6=m7;
m7=m8;
m8=m9;
m9=m10;
m10=m11;
m11=m12;
m12=m13;
m13=m14;
m14=m15;
m15=m16;
m16=m17;
m17=m18;
m18=m19;
m19=m20;
m20=m21;
m21=m22;
m22=m23;
m23=m24;
m24=m25;
m25=m26;
m26=m27;
m27=m28;
m28=m29;
m29=m30;
m30=m31;
m31=m32;
m32=m33;
m33=m34;
m34=m35;
m35=m36;
m36=m37;
m37=m38;
m38=m39;
m39=m40;
m40=m41;
m41=m42;
m42=m43;
m43=m44;
m44=m45;
m45=m0;

/////////////////////////////////////
d0=d1;
d1=d2;
d2=d3;
d3=d4;
d4=d5;
d5=d6;
d6=d7;
d7=d8;
d8=d9;
d9=d10;
d10=d11;
d11=d12;
d12=d13;
d13=d14;
d14=d15;
d15=d16;
d16=d17;
d17=d18;
d18=d19;
d19=d20;
d20=d21;
d21=d22;
d22=d23;
d23=d24;
d24=d25;
d25=d26;
d26=d27;
d27=d28;
d28=d29;
d29=d30;
d30=d31;
d31=d32;
d32=d33;
d33=d34;
d34=d35;
d35=d36;
d36=d37;
d37=d38;
d38=d39;
d39=d40;
d40=d41;
d41=d42;
d42=d43;
d43=d44;
d44=d45;
d45=d0;
///////////////////////////////////////////////
goto loop;
}

((((((((((((  
) v 

"  Q
 )#
 B ', E 3 Q   (40$ 2
 .   3 
))  <  0 /, 5 '0Y(( /0

'  $   40$ B',
 7 /, 0:Y"+ -

)4 .07
=<   .E

3  7"+  y  


, '3E' $  ( -. 

, 5<  Sw 5B=  ) v ,.

 :
Sv  Matrix led 6x6 'EY '7<R(3 ) ( Pic 16F628A<3 (3 S " ,'.
3 E"    .

  PDF 2, -0v [


 .

 0 = 'B. -0


  :
.

7 PIC16F628A IC 1)  12
7 7805 IC 1)  .  1
7 0 36  )   0.25.  9 -.
7 uf740 2:., 1)  .  0.50
7 n100 w 2:., 2)  .  0.50
7  1 Adaptor)  .  0.500

4,' -:
  -0=    503 U= /7 '0vZ 
 = .  #, ".0<Y
!0  v    -  ' ) Q< (

http://www.youtube.com/watch?v=Nf5XP8BudVs
7  
 <,

:*

char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char
char

x1=0b00000000;
x2=0b00000000;
x3=0b00000000;
x4=0b00000000;
x5=0b00000000;
x6=0b00000000;
x7=0b00000000;
x8=0b00111111;
x9=0b00000000;
x10=0b00111111;
x11=0b00000001;
x12=0b00111111;
x13=0b00000001;
x14=0b00011111;
x15=0b00010100;
x16=0b00001000;
x17=0b00000000;
x18=0b00111111;
x19=0b00000000;
x20=0b00100000;
x21=0b00100000;
x22=0b00111100;
x23=0b00000100;
x24=0b00001101;
x25=0b00000100;
x26=0b00001100;
x27=0b00000010;
x28=0b00000001;
x29=0b00000001;
x30=0b00000000;
x31=0b00000000;
x32=0b00000000;
x33=0b00000000;
x34=0b00000000;
x35=0b00000000;

char n;
void main()
{
TRISB=0;
PORTB=0;
TRISa=0;
PORTa=0;
loop:
for(n=0;n<100;n++){

PORTa=0B11001110;
PORTB=x1; delay_us(300);
PORTa=0B11001101;
PORTB=x2; delay_us(300);
PORTa=0B11001011;
PORTB=x3; delay_us(300);
PORTa=0B11000111;
PORTB=x4; delay_us(300);
PORTa=0B10001111;
PORTB=x5; delay_us(300);

PORTa=0B01001111;
PORTB=x6; delay_us(300);

x1=x2;
x2=x3;
x3=x4;
x4=x5;
x5=x6;
x6=x7;
x7=x8;
x8=x9;
x9=x10;
x10=x11;
x11=x12;
x12=x13;
x13=x14;
x14=x15;
x15=x16;
x16=x17;
x17=x18;
x18=x19;
x19=x20;
x20=x21;
x21=x22;
x22=x23;
x23=x24;
x24=x25;
x25=x26;
x26=x27;
x27=x28;
x28=x29;
x29=x30;
x30=x31;
x31=x32;
x32=x33;
x33=x34;
x34=x35;
x35=x1;
goto loop;
}
-: '0< 3 - ( Pic ) ,(3 ,
.4MHz B   ,  -1
. ( PIC 16F84 ) :' 0:, .7 7 Port B = 8 Port A = 8 = 16  -2
.  0:,  3   + -3
. ' 0:,  3  + -4
.  /, : $ 4+),  -5
) ,<  ' -<$    0 t+ =-0[Y    -0 ! -6
.MCLR -7 B( INTRC_OSC_NOCLIKOUT

'07 !.  , -  JDM Programmer ' +,< S  ,(3 B '+,< '<)


 ,
"0
5'   R0) "!.
'+,< S

 -0v  '7<R[


 .
. 0  7v :

PICPgm Programmer , " ,< '<)


 ,  ' 3  0<. 03
 -0< ,[
 .
" . 3 # '.Y,  5 Y 3 Q 7 t0

 #0. '3

You might also like