|
希望有帮助于你们
- #include<reg52.h>
- #define uchar unsigned char
- #define uint unsigned int
- uchar step_table[] = {0x40,0x20,0x10,0x08}; //0100 0000 0010 0000 0001 0000 0000 1000
- void delay(uint a)
- {
- while(a--);
- }
- void main()
- {
- uchar i;
- uint j = 512;
- while(j--)
- {
- for(i=0;i<4;i++)
- {
- P0 = step_table[i];
- delay(800);
- }
-
- }
- while(1);
- }
复制代码
|
评分
-
查看全部评分
|