|
程序部分" ^* ]; A+ g" }
#include <reg51.h>, Q9 h! }/ ]* S. |
void delay (unsigned int i)
4 O1 c: M1 K, H& _) Z4 p2 ~{
( p! f- C7 h6 N. P. Dunsigned int k;
1 B6 e0 |, _8 a- f* `5 afor (k=0;k<i;k++);$ ^, D6 b' U; X8 _) a( O6 C
}8 N+ H7 Q5 ]8 L' D! a# c2 v2 c, f
void main()1 I* j9 q- h" K% _; ]
{
1 @9 O- i. C$ [# [+ N# M& c Hunsigned char aa,i;9 @! L5 h( q# v4 F7 _( a! B" a
while(1)- _; U% w2 s% J' l4 N5 x
{) e$ b1 q* K" a0 E4 I
aa=0x80;$ B ] T I8 ^8 p4 R" z
for(i=0;i<8;i++)
3 W* q" p% ^7 ]. N& ?. W" Y{ W9 O6 Q- y* x2 I8 A0 s
P1=aa;; h0 ?# Z+ N: C* c7 E
delay(25000);6 ?# @( C( b( i1 n% u9 x+ l
aa>>=1;//左移
- A3 m$ K* ]# u) ^/ Y* F}2 L0 H/ N! G. @, q3 p6 b2 \
}
! d% y( u' y# `: S0 e$ l. |}
6 j9 E" c1 B) d5 z' W B7 E2 g( Q& P9 Y/ ?
" W& o7 t" Z# i
|
|