|
程序部分
( ?; }+ J, Q: o' M: o0 ?#include <reg51.h>$ B+ M9 K" c, L+ D! Z4 |+ B6 \ r
void delay (unsigned int i)
- j) m2 O' ]; ~1 \4 h6 s. K7 O7 r{8 t, v, ~# a/ s4 G( F6 \ X" ^
unsigned int k;
5 J! Y8 r+ D }for (k=0;k<i;k++);/ S* _8 J) J0 x
}
) ]8 y4 U9 [& m1 E; h( lvoid main()3 C2 I& N8 K5 u4 m
{5 @' n. k2 m3 u; Y( A, Z
unsigned char aa,i;' Z& x& D) h2 i7 K; w' Y0 P
while(1)% e1 l6 J1 L6 ?" L! s
{
: p y0 y4 l4 w# l9 l! ?) a' Laa=0x80;
6 J2 i0 q* M1 q& x" |for(i=0;i<8;i++)
# P* N- h5 F G6 S7 O{
' ]; B$ J4 O4 HP1=aa;
, p ?, P0 K! i3 l; c' A* Tdelay(25000);% o- i7 Y/ {# |3 f( e
aa>>=1;//左移7 Q$ j) x5 G2 {8 s) |
}
9 I7 C7 r" ~% m}
) { O4 P7 ^* V}9 S# T# [0 M. C5 s0 \1 C2 t/ I
4 c; } S6 a( {) g7 D c& H' u. w3 v/ G x' o
|
|