課程設計電風扇
Ⅰ 基於單片機的溫控電風扇的設計
我給你18B20的程序吧,控制應該好寫。
////初始化18B20/////////
bit init18b20(void)
{
uint i;
bit no;
DS=0;
i=103;
while(i>0)i--;
DS=1;
i=4;
while(i>0)i--;
no=DS;
if(no==0)
{
DS=1;
i=100;
while(i>0)i--;
no=DS;
if(no==1)
not=0;
else
not=1;
}
else
not=1;
return (not);
}
bit tmpreadbit(void)
{
uint i;
bit dat;
DS=0;
i++;
DS=1;
i++;i++;
dat=DS;
i=8;while(i>0)i--;
return (dat);
}
uchar tmpread(void)
{
uchar i,j,dat;
dat=0;
for(i=1;i<=8;i++)
{
j=tmpreadbit();
dat=(j<<7)|(dat>>1);
}
return(dat);
}
void tmpwritebyte(uchar dat) //
{
uint i;
uchar j;
bit testb;
for(j=1;j<=8;j++)
{
testb=dat&0x01;
dat=dat>>1;
if(testb) //write 1
{
DS=0;
i++;i++;
DS=1;
i=8;while(i>0)i--;
}
else
{
DS=0; //write 0
i=8;
while(i>0)i--;
DS=1;
i++;i++;
}
}
}
int tmp() //DS18B20溫度讀取
{
float tt;
int a,b;
if(init18b20()==0)
{
EA=0;
delay(1);
tmpwritebyte(0xcc); // 跳過讀ROM操作
tmpwritebyte(0x44); // 啟動溫度轉換
delay(10);
init18b20();
delay(1);
tmpwritebyte(0xcc);
tmpwritebyte(0xbe);
a=tmpread();
b=tmpread();
temp=b;
temp<<=8; //將高位元組溫度數據與低位元組溫度數據整合
temp=temp|a;
c=b>>4;
tt=temp*0.0625;
temp=tt*10+0.5;
EA=1;
return temp;
}
else
not=1;
}
Ⅱ 簡單51單片機課程設計 關於電風扇的(包括一個開關一個流水燈一個定時器差不多就行了)
額~~~~~~~這東西要自己想一下啊!
Ⅲ 台式電風扇搖頭裝置機械原理課程設計,要求15頁紙。
沒有電子版啊,抱歉了、、、、、、
Ⅳ 急求!電風扇控制電路的設計(數字邏輯課程設計)
電風扇控制電路的設計(數字邏輯課程設計)你好,我有這些文檔.