當前位置:首頁 » 課程大全 » 課程設計電風扇

課程設計電風扇

發布時間: 2020-11-30 03:02:11

Ⅰ 基於單片機的溫控電風扇的設計

我給你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頁紙。

沒有電子版啊,抱歉了、、、、、、

Ⅳ 急求!電風扇控制電路的設計(數字邏輯課程設計)

電風扇控制電路的設計(數字邏輯課程設計)你好,我有這些文檔.

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919