在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 51單片機(jī)按鍵直接控制舵機(jī)旋轉(zhuǎn)

            51單片機(jī)按鍵直接控制舵機(jī)旋轉(zhuǎn)

            作者: 時(shí)間:2016-11-19 來源:網(wǎng)絡(luò) 收藏
            #include
            #include typedef unsigned char uchar;typedef unsigned int uint;sbit  KEY1=P3^4;sbit  KEY2=P3^5;sbit  KEY3=P3^6;sbit  KEY4=P3^7;void Delay(unsigned int s);uchar flag_0;uchar flag_1;void Delay(unsigned int s){unsigned int i;for(i=0; iinterrupt 1 {       if(flag_0==1)	PWM_Value[0]+=1;if(flag_0==2)	PWM_Value[0]-=1;if(flag_1==1)	PWM_Value[1]+=1;if(flag_1==2)	PWM_Value[1]-=1;if(PWM_Value[0]>=2500)PWM_Value[0]=2500;if(PWM_Value[1]>=2500)PWM_Value[1]=2500;if(PWM_Value[0]<=500)PWM_Value[0]=500;if(PWM_Value[1]<=500)PWM_Value[1]=500;switch(order){case 1:PWM_OUT0=1;TH0=(65536-PWM_Value[0])>>8; TL0=(uchar)(65536-PWM_Value[0]);break;                          case 2:PWM_OUT0=0;TH0=(65536-(5000-PWM_Value[0]))>>8;    TL0=(uchar)(65536-(5000-PWM_Value[0]));break;                          case 3:PWM_OUT1=1;TH0=(65536-PWM_Value[1])>>8; TL0=(uchar)(65536-PWM_Value[1]);break;                          case 4:PWM_OUT1=0;TH0=(65536-(5000-PWM_Value[1]))>>8;    TL0=(uchar)(65536-(5000-PWM_Value[1]));break;                              case 5:TH0=60536>>8;   TL0=(uchar)60536;break;case 6:TH0=60536>>8;   TL0=(uchar)60536;order=0;break;default: order=0; break;}order++;}


            評(píng)論


            技術(shù)專區(qū)

            關(guān)閉