freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于單片機(jī)的智能溫室溫濕度控制系統(tǒng)的設(shè)計畢業(yè)設(shè)計-資料下載頁

2025-06-19 12:55本頁面
  

【正文】 { RH_data = RH_temp;RL_data = RL_temp; TH_data = TH_temp;TL_data = TL_temp; CK_data = CK_temp; } } //濕度整數(shù)部分 TxBuf[0] = (char)(0X30+RH_data/10); TxBuf[1] = (char)(0X30+RH_data%10); TxBuf[2] = 0x2e; //小數(shù)點 //濕度小數(shù)部分 TxBuf[3] = (char)(0X30+RL_data/10); TxBuf[4] = 0X25;//% TxBuf[5] = 0X52; //R TxBuf[6] = 0X48; //H //溫度整數(shù)部分 TxBuf[7] = (char)(0X30+TH_data/10); TxBuf[8] = (char)(0X30+TH_data%10); TxBuf[9] = 0x2e;//小數(shù)點 //溫度小數(shù)部分 TxBuf[10] = (char)(0X30+TL_data/10); TxBuf[11] = 0X27; //39。 TxBuf[12] = 0X43; //C}接收部分程序include include typedef unsigned char uchar;typedef unsigned char uint;//************************IO端口定義************************sbit MISO=P0^5;sbit MOSI=P0^1;sbit SCK=P0^4;sbit CE=P0^3;sbit CSN=P0^0;sbit IRQ=P0^2;uchar RxBuf[32]={0};unsigned char code dianya1[]={溫度顯示:};unsigned char code dianya2[]={濕度顯示:};//*************************按鍵**************************//*******************數(shù)碼管09編碼**********************uchar seg[10]={0xC0,0xCF,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90}; //0~~9段碼void delayms(unsigned char);void keyscan();//記憶按鍵狀態(tài)void da_in();//將按鍵值轉(zhuǎn)化并送入到DA中void dianliu_to_lcd();//將按鍵狀態(tài)值送入LCDvoid dianya_to_lcd();//將按鍵狀態(tài)值送入LCDvoid ad();//得到AD采樣的值void send(unsigned char );//向LCD發(fā)命令void senddata(unsigned char dat);//向LCD發(fā)數(shù)據(jù)void lcd_init();//LCD初始化void T_init();//定時器初始化void autosaodianliu(); int od_data,op_data,oz_data;void change(int dat);unsigned char code dianliu1[]={設(shè)置電流:mA};unsigned char code dianliu2[]={實際電流:mA;sbit sid=P3^6;//LCD串行數(shù)據(jù)輸入端sbit clk=P3^4;//LCD時鐘輸入端sbit cs=P3^5;//LCD片選unsigned char key_button=0;unsigned char key[3],j=0,i=0;//KEY數(shù)組用來存放按鍵按下的值unsigned int ad1,ad2,advalue;//用于取AD采樣值bit flag=0;int d_data,pf_data,t_data;unsigned char z1_data,z2_data;int knum,aa=0,p_data,z_data,t_on;//****************************************************define TX_ADR_WIDTH 5 // 5 uints TX address widthdefine RX_ADR_WIDTH 5 // 5 uints RX address widthdefine TX_PLOAD_WIDTH 32 // 20 uints TX payloaddefine RX_PLOAD_WIDTH 32 // 20 uints TX payloaduint const TX_ADDRESS[TX_ADR_WIDTH]= {0x34,0x43,0x10,0x10,0x01}; //本地地址uint const RX_ADDRESS[RX_ADR_WIDTH]= {0x34,0x43,0x10,0x10,0x01}; //接收地址//*******************NRF24L01寄存器指令*******************define READ_REG 0x00 // 讀寄存器指令define WRITE_REG 0x20 // 寫寄存器指令define RD_RX_PLOAD 0x61 // 讀取接收數(shù)據(jù)指令define WR_TX_PLOAD 0xA0 // 寫待發(fā)數(shù)據(jù)指令define FLUSH_TX 0xE1 // 沖洗發(fā)送 FIFO指令define FLUSH_RX 0xE2 // 沖洗接收 FIFO指令define REUSE_TX_PL 0xE3 // 定義重復(fù)裝載數(shù)據(jù)指令define NOP 0xFF // 保留//******************SPI(nRF24L01)寄存器地址*****************define CONFIG 0x00 // 配置收發(fā)狀態(tài),CRC校驗?zāi)J揭约笆瞻l(fā)狀態(tài)響應(yīng)方式define EN_AA 0x01 // 自動應(yīng)答功能設(shè)置define EN_RXADDR 0x02 // 可用信道設(shè)置define SETUP_AW 0x03 // 收發(fā)地址寬度設(shè)置define SETUP_RETR 0x04 // 自動重發(fā)功能設(shè)置define RF_CH 0x05 // 工作頻率設(shè)置define RF_SETUP 0x06 // 發(fā)射速率、功耗功能設(shè)置define STATUS 0x07 // 狀態(tài)寄存器define OBSERVE_TX 0x08 // 發(fā)送監(jiān)測功能define CD 0x09 // 地址檢測 define RX_ADDR_P0 0x0A // 頻道0接收數(shù)據(jù)地址define RX_ADDR_P1 0x0B // 頻道1接收數(shù)據(jù)地址define RX_ADDR_P2 0x0C // 頻道2接收數(shù)據(jù)地址define RX_ADDR_P3 0x0D // 頻道3接收數(shù)據(jù)地址define RX_ADDR_P4 0x0E // 頻道4接收數(shù)據(jù)地址define RX_ADDR_P5 0x0F // 頻道5接收數(shù)據(jù)地址define TX_ADDR 0x10 // 發(fā)送地址寄存器define RX_PW_P0 0x11 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P1 0x12 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P2 0x13 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P3 0x14 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P4 0x15 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P5 0x16 // 接收頻道0接收數(shù)據(jù)長度define FIFO_STATUS 0x17 // FIFO棧入棧出狀態(tài)寄存器設(shè)置//****************************************************void Delay(unsigned int s);void inerDelay_us(unsigned char n);void init_NRF24L01(void);uint SPI_RW(uint uchar);uchar SPI_Read(uchar reg);void SetRX_Mode(void);uint SPI_RW_Reg(uchar reg, uchar value);uint SPI_Read_Buf(uchar reg, uchar *pBuf, uchar uchars);uint SPI_Write_Buf(uchar reg, uchar *pBuf, uchar uchars);unsigned char nRF24L01_RxPacket(unsigned char* rx_buf);void nRF24L01_TxPacket(unsigned char * tx_buf);//**********************長延時***********************void Delay(unsigned int s){ unsigned int i; for(i=0; is; i++); for(i=0; is; i++);}//******************************************************uint bdata sta; //狀態(tài)標(biāo)志sbit RX_DR =sta^6;sbit TX_DS=sta^5;sbit MAX_RT=sta^4;/*******************************************************/*延時函數(shù)/*******************************************************/void inerDelay_us(unsigned char n){ for(n0;n) _nop_();}void delayms(unsigned char i){unsigned char j=120;while(i) while(j);}void send(unsigned char )//向LCD發(fā)命令{unsigned char a,i; cs=1;clk=0;a=0xf8; for(i=0。i8。i++) {sid=(bit)(aamp。0x80) clk=0;clk=1;a=a1; } a=amp。0xf0; for(i=0。i8。i++) {sid=(bit)(aamp。0x80); clk=0;clk=1;a=a1; } a=4; for(i=0;i8;i++) {sid=(bit)(aamp。0x80); clk=0;clk=1;a=a1; } cs=0;delayms(1);}void senddata(unsigned char dat)//向LCD發(fā)數(shù)據(jù){unsigned char a,i; cs=1;clk=0;a=0xfa; for(i=0。i8。i++) {sid=(bit)(aamp。0x80); clk=0;clk=1;a=a1; } a=datamp。0xf0; for(i=0。i8。i++) {sid=(bit)(aamp。0x80); clk=0;clk=1;a=a1; } a=dat4; for(i=0。i8。i++) {sid=(bit)(aamp。0x80); clk=0;clk=1;a=a1; } cs=0; delayms(1); }void lcd_init()//LCD初始化{ delayms(100);send(0x30);send(0x02);send(0x06); send(0x0c);send(0x01);send(0x80); }void keyscan()//按鍵掃描,將其存入KEY[3]中{unsigned char temp; if(i=3) i=0;if(flag==1)//按下過START后才執(zhí)行以下程序
點擊復(fù)制文檔內(nèi)容
教學(xué)教案相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1