亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码
標題:
電機的正反轉
[打印本頁]
作者:
青春勝過年華
時間:
2016-9-20 15:44
標題:
電機的正反轉
#include <reg51.h>
#define uchar unsigned char
#define uint unsigned int
void delayms(uint);
sbit pwm=P2^7;
uchar aa=1,bb=0,cc=0,dd=0,ee=1;
void main()
{
TMOD=0X01;
TH0=(65536-1000)/256;
TL0=(65536-1000)/256;
EA=1;
ET0=1;
TR0=1;
while(1);
}
void key() //按鍵檢測處理函數
{
uchar temp;
P3=0xfe;
temp=P3;
temp=(temp&0xf0);
if(temp!=0xf0)
{
delayms(10);
if(temp!=0xf0)
{
temp=P3; //消抖
switch(temp)
{
case 0xee:
TR0=~TR0;
break;
case 0xde:
if(cc==0)
aa+=10;
if(aa>100)
aa=1;
break;
}
while(temp!=0xf0) //等待按鍵釋放
{
temp=P3;
temp=temp&0xf0;
}
}
}
P3=0xfd;
temp=P3;
temp=(temp&0xf0);
if(temp!=0xf0)
{
delayms(10);
if(temp!=0xf0)
{
temp=P3;
switch(temp)
{
case 0xed:
if(dd=0)
aa+=1;
break;
case 0xdd:
if(cc=1)
cc=1;
dd=1;
break;
}
while(temp!=0xf0)
{
temp=P3;
temp=temp&0xf0;
}
}
}
}
void time1()interrupt 3
{
TH0=(65536-1000)/256;
TL0=(65536-1000)/256;
bb++;
if(bb>=100) bb=0;
if(bb<=aa)
pwm=1;
else
pwm=0;
}
void time2()interrupt 1
{
}
void delayms(uint xms)
{
uint i,j;
for(i=xms;i>0;i++)
for(j=110;j>0;j++);
}
作者:
青春勝過年華
時間:
2016-9-20 15:44
這只是一部分代碼
歡迎光臨 (http://www.denmoz.com/bbs/)
Powered by Discuz! X3.1