diff --git a/Dorm-Air-Conditioner-Smart-Controller.ino b/Dorm-Air-Conditioner-Smart-Controller.ino index 3d5da4f..4c4b46a 100644 --- a/Dorm-Air-Conditioner-Smart-Controller.ino +++ b/Dorm-Air-Conditioner-Smart-Controller.ino @@ -1,36 +1,23 @@ #include "DHT11control.h" +#include "RTC_Module.h" +#include + +ThreeWire myWire(4,5,2); +RtcDS1302 Rtc(myWire); + void setup() { // 初始化串口通信 Serial.begin(115200); + // 启动DHT传感器 dht.begin(); + // 启动ds1302 + setupRTC(); + } void loop() { - //接下来都只是为了让串口监视器能输出温度和湿度,判断dht11是否正常工作,后续会删除 - - - // 获取温湿度数据指针 - float* results = getTempAndHumidity(); - - // 数据有效性校验 - if(results[0] != -999 && results[1] != -999) { - // 格式化输出温度数据 - Serial.print("Temperature: "); - Serial.print(results[0]); - Serial.print(" °C, "); - - // 格式化输出湿度数据 - Serial.print("Humidity: "); - Serial.print(results[1]); - Serial.println(" %"); - } - - // 维持2秒采样间隔 - delay(2000); - - - //到此为止 +//暂时留空备用,函数调用方法已转移至文档 } \ No newline at end of file