ObjectBlocks: WeatherStation

From OnnoWiki
Revision as of 22:45, 19 March 2023 by Onnowpurbo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Objectblocks-weather-station.png


#include <DHT.h>
#include "Channel.h"

DHT dht(2, DHT11);
 

void setup() {
  Channel.connect("mFPdJAqtBzpu7t");
  dht.begin();
}

void loop() {
  Channel.sendNumber("TEMP", dht.readTemperature());
  delay(1000);
  Channel.sendNumber("HUMIDITY", dht.readHumidity());
  delay(1000);
}



Pranala Menarik