|
- #include<reg51.h>
- void Delay1(int del)
- {
- int i,j;
- for(i=0; i<del; i++)
- for(j=0; j<1827; j++)
- ;
- }
- void Delay(unsigned int t)
- {
- while(--t);
- }
- //????
- unsigned int z,y;
- void main (void)//???
- {
- unsigned int CYCLE=400,PWM_LOW=0;//???????
- while (1) //???
- {
- /*--------??LED???---------*/
-
- Delay1(100); //???,?????????(??????)
- for(PWM_LOW=1;PWM_LOW<CYCLE;PWM_LOW++) //PWM_LOW???
- {
- P1=0x00;
- Delay(PWM_LOW);
- P1=0xff;
- Delay(CYCLE-PWM_LOW);
- }
- P1=0xff;
- for(PWM_LOW=CYCLE-1;PWM_LOW>0;PWM_LOW--) //??????????
- {
- P1=0x00; //??LED
- Delay(PWM_LOW);
- P1=0xff; //??LED
- Delay(CYCLE-PWM_LOW);
- }
- }
- }
复制代码
希望用的到的学习下
|
|