}
void setup() {
-
+
+ Serial1.begin(115200); // Set the baud.
+
+ // Wait for U-boot to finish startup. Consume all bytes until we are done.
+ do {
+ while (Serial1.available() > 0) {
+ Serial1.read();
+ }
+
+ delay(1000);
+ } while (Serial1.available()>0);
+
Serial1.begin(57600);
Serial1.println();
Serial1.println("STATUS:STARTING");
unsigned long previousIndoor = 0;
unsigned long previousOutdoor = 0;
+float temperature;
+float pressure;
void loop() {
unsigned long now;
if ((unsigned long)(now - previousMillis) >= indoor_interval) {
previousMillis = now;
-
+
int chk = DHT.read11(DHT11PIN);
if (chk==0) {
Serial1.print(",TEMPERATURE=");
Serial1.print(DHT.temperature);
- Serial1.println();
- Serial1.print("SENSOR:TYPE=BARO,");
- Serial1.print("PRESSURE=");
- Serial1.print(bmp.readPressure());
- Serial1.print(",TEMPERATURE=");
- Serial1.println(bmp.readTemperature());
-
previousIndoor = now;
digitalWrite(GREENPIN,HIGH);
}
+ pressure=bmp.readPressure();
+ temperature=bmp.readTemperature();
+ Serial1.println();
+ Serial1.print("SENSOR:TYPE=BARO,");
+ Serial1.print("PRESSURE=");
+ Serial1.print(pressure);
+ Serial1.print(",TEMPERATURE=");
+ Serial1.println(temperature);
+
}
if ((unsigned long)(now - previousIndoor) > indoor_interval*10) {