l184890962:
#include#defineuintunsignedint#defineucharunsignedcharunsignedchara[4];//储存用户码、用户反码与键数据码、键数据反码unsignedintLowTime,HighTime;//储存高、低电平的宽度sbitled_r=P1^0;sbitled_g=P1^2;sbitled_b=P1^4;sbitIR=P3^2;sbitBEEP=P2^3;bitkg_flag;bitzb_flag;bitm_flag;bits_flag;bitf_flag;ucharnum,tl,tb,tm,tj;tt;ucharnumber;ucharscw;ucharpwm_r,pwm_g,pwm_b;ucharpwm[3];ucharbright,bright_t;ucharx[30]={0};uchartype[30]={0};voiddealy(uintz){uintx,y;for(x=z;x>0;x--)for(y=110;y>0;y--);}voidinit(){TMOD=0x01;TH0=0;//定时器清0TL0=0;EA=1;ET0=1;//IT0=1;EX0=1;//PT0=1;//PX0=0;TR0=1;TH1=(65536-1000)/256;TL1=(65536-1000)%256;ET1=1;EA=1;//IT0=1;//EX0=1;PT1=1;//PX0=0;TR1=1;scw=0;tl=20;tb=100;tm=20;tj=100;kg_flag=0;zb_flag=0;m_flag=0;s_flag=0;f_flag=0;bright=255;bright_t=255;pwm[0]=0;pwm[1]=0;pwm[2]=0;}//voidbeep()//蜂鸣器响一声函数//{//unsignedchari;//for(i=0;i420)&&(HighTime1300)&&(HighTime7800)&&(LowTime3600)&&(HighTime0){led_r=0;pwm_r--;}else{led_r=1;}if(pwm_g>0){led_g=0;pwm_g--;}else{led_g=1;}if(pwm_b>0){led_b=0;pwm_b--;}else{led_b=1;}这个调了下T1工作了但还是不能调光,调光部分怎么写请高手指点