1. The motor module is mainly responsible for providing drive control for the opening and closing of the smart window.
2. The button module inputs a signal to the system and manually controls the opening and closing window.
3. The raindrop detection module, smoke detection module and humidity detection module are used to detect the relevant indicators. After receiving the signal, the system processor can intelligently analyze and judge the opening and closing window.
4. The alarm detection module is used to detect theft, and can sound the alarm and close the window.
5. If the smoke is too high, it is to open the window.
6. Close the window when a human body is detected.
#include "adc0832.h"#include "intrins.h"Read the ad value unsigned int adc0832(unsigned char channel) ad conversion, and return the result for (i = 0; i < 8;i++) 8 cycles ADCS = 1; Clear slice selection adclk = 0; pull down the clock addi=1; dat <<= 8;Data Shift dat |= ndat;merge data return(ndat); }
#include "dht11.h"unsigned char dht11_dat[5];Humidity + Temperature + Sum Void Delay1ms(unsigned int i) Delay Function}void dht11 recive() Receive if(i==1000) for(i=0; i<1000;i++) Wait for the response to end if(i==1000) for(i=0; i<1000;i++) Wait to start if(i==1000) for(k=0; k<5;k++) receive 5 data if(i==1000) ***== for(i=0; i<1000;i++) wait for the start signal if(i==1000) if(i<5) m++; dht11_dat[k]=~m; }delay1ms(1);
Edit. Edit Edit.
The information is based on this