成人免费无码不卡毛片,亚洲AⅤ无码精品一区二区三区,国产尤物精品视频,久久精品日本亚洲,欧美成人一区三区无码乱码A片,中文字日产幕码一区二区色哟哟,亞洲日韓中文字幕網AV

  • 方案介紹
  • 附件下載
  • 相關(guān)推薦
申請入駐 產(chǎn)業(yè)圖譜

基于51單片機(jī)的礦井通風(fēng)報(bào)警【溫度、煙霧、甲烷】(仿真)

2024/11/15
1668
加入交流群
掃碼加入
獲取工程師必備禮包
參與熱點(diǎn)資訊討論

有需要資料的可了解一下.docx

共1個(gè)文件

礦井報(bào)警器:

1、檢測井內(nèi)溫度、粉塵、甲烷

2、設(shè)定報(bào)警值,數(shù)值超過報(bào)警值啟動報(bào)警

3、通風(fēng)控制,測量值越高,風(fēng)扇速度越快

#include "ADC0832.h"
#include "intrins.h"
//讀取AD值
unsigned int ADC0832(unsigned char channel)  //AD轉(zhuǎn)換,返回結(jié)果
{
	unsigned char i = 0;
	unsigned char j;
	unsigned int dat = 0;
	unsigned char ndat = 0;

	if (channel == 0) channel = 2;//通道1
	if (channel == 1) channel = 3;//通道2
	ADDI = 1;//輸入引腳拉高
	_nop_();//延時(shí)1us
	_nop_();//延時(shí)1us
	ADCS = 0;//片選
	_nop_();//延時(shí)1us
	_nop_();//延時(shí)1us
	ADCLK = 1;//拉高時(shí)鐘
	_nop_();//延時(shí)1us
	_nop_();//延時(shí)1us
	ADCLK = 0;//拉低時(shí)鐘
	_nop_();//延時(shí)1us
	_nop_();//延時(shí)1us
	ADCLK = 1;//拉高時(shí)鐘
	ADDI = channel & 0x1;
	_nop_();//延時(shí)1us
	_nop_();//延時(shí)1us
	ADCLK = 0;//拉低時(shí)鐘
	_nop_();//延時(shí)1us
	_nop_();//延時(shí)1us
	ADCLK = 1;//拉高時(shí)鐘
	ADDI = (channel >> 1) & 0x1;
	_nop_();//延時(shí)1us
	_nop_();//延時(shí)1us
	ADCLK = 0;//拉低時(shí)鐘
	ADDI = 1;//輸出1
	_nop_();//延時(shí)1us
	_nop_();//延時(shí)1us
	dat = 0; //存儲清零
	ADDI =1;
	for (i = 0; i < 8; i++)	//循環(huán)8次
	{
		dat |= ADDI;//讀取引腳
		ADCLK = 1; //拉高時(shí)鐘
		_nop_();//延時(shí)1us
		_nop_();//延時(shí)1us
		ADCLK = 0;//拉低時(shí)鐘
		_nop_();//延時(shí)1us
		_nop_();//延時(shí)1us
		dat <<= 1;//左移
		if (i == 7) dat |= ADDI;//讀取引腳
	}
	for (i = 0; i < 8; i++)//循環(huán)8次
	{
		j = 0;
		j = j | ADDI; //讀取引腳
		ADCLK = 1;	//拉高時(shí)鐘
		_nop_();//延時(shí)1us
		_nop_();//延時(shí)1us
		ADCLK = 0;	//拉低時(shí)鐘
		_nop_();//延時(shí)1us
		_nop_();//延時(shí)1us
		j = j << 7;	//左移7位
		ndat = ndat | j; //合并數(shù)據(jù)
		if (i < 7) ndat >>= 1;//去掉符號
	}
	ADCS = 1; //清除片選
	ADCLK = 0;//拉低時(shí)鐘
	ADDI=1;
	dat <<= 8;//數(shù)據(jù)移位
	dat |= ndat;//合并數(shù)據(jù)
	return(ndat);
}

  • 有需要資料的可了解一下.docx
    下載

相關(guān)推薦

方案定制

去合作
方案開發(fā)定制化,2000+方案商即時(shí)響應(yīng)!
娄烦县| 阿拉善左旗| 竹山县| 西峡县| 清河县| 剑川县| 奉节县| 防城港市| 武夷山市| 莫力| 泽州县| 含山县| 游戏| 五家渠市| 韩城市| 调兵山市| 罗平县| 伊通| 灵璧县| 萨迦县| 班戈县| 璧山县| 兴安盟| 高密市| 公主岭市| 乳山市| 通榆县| 枣阳市| 成安县| 延寿县| 宣威市| 丰宁| 哈巴河县| 巧家县| 东方市| 噶尔县| 广元市| 弋阳县| 察隅县| 拜泉县| 攀枝花市|