|
程序部分# M8 W$ | v: @
#include <reg51.h># K, ]- z9 m. |
void delay (unsigned int i)
% U* W& g4 y+ z4 L, x0 M; F{; w( [/ N8 O' F! c, }2 F
unsigned int k;: m# {' K( d- _' q$ W
for (k=0;k<i;k++);
+ [6 { M0 P( p6 ]' S8 h}
5 t3 _: c) p" G# ^void main()
8 C: o8 t; w9 o* [! v4 S5 \{ H( f) B V" k) x
unsigned char aa,i;
: H6 A, A( e) b! R/ C) N* ~# Qwhile(1)0 x$ A: o9 X+ P
{. |2 w6 W' Q( V+ @ V6 A) A9 \% e' i
aa=0x80;
- h( r/ g3 _. L% _# D' n8 tfor(i=0;i<8;i++)1 n% G1 o5 l* p: S& W
{1 e# m6 p5 l8 Q# P) A$ P
P1=aa;
! }7 L3 S& h$ S# Udelay(25000);& n0 q. G0 w% l$ }8 H. D
aa>>=1;//左移% ^3 h0 Y O& W' }' j$ I+ T9 P
}
& p5 j5 Y* ]0 |5 d} H/ c) l3 a) l s, \
}
$ ]( Q/ \7 A: K ?; ^0 e$ d
( S+ U# R1 C) @2 W2 G4 R; m3 W4 L+ z# b" S+ f
|
|