GrayAngel

code about led_shake
 1 //write by:cyt
 2 //Project Name:Led on/off
 3 //Time:2017-2-10
 4 #include<reg51.h>
 5 void delay(int c)
 6 {
 7     int a=38;
 8     int b=130;
 9     for(;c>0;c--)
10     {
11         for(;a>0;a--)
12             for(;b>0;b--)
13                 ;
14     }
15 }
16 void main()
17 {
18 
19     delay(1);
20 
21     while(1)
22     {
23         unsigned char i=0;
24         delay(50);
25         P0 = 0x00;
26         delay(50);
27         P0 = 0xff;
28     }
29 }
30                 
led_shake

 

posted on 2017-02-10 16:35  GrayAngel  阅读(177)  评论(0编辑  收藏  举报