- #include<reg51.h>
- #include<intrins.h>
- #define uint unsigned int
- #define uchar unsigned char
- uint t0;
- void init()
- {
- TMOD=0x11;
- TH0=(65535-50000)/256;
- TL0=(65535-50000)%256;
- EA=1;
- EX0=1;
- TR0=1;
- }
- void main()
- {
- P1=0x01;
- t0=P1;
- while(1)
- {
- init();
- }
- }
- void timer0() interrupt 0
- {
- TH0=(65535-50000)/256;
- TL0=(65535-50000)%256;
- t0=_cror_(t0,1);
- }
复制代码
我想做一个LED流水灯 下载进去后 灯不会移位~~~请高手指点指点~~
一周热门 更多>