Difference between revisions of "ObjectBlocks: WeatherStation"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with "center|600px|thumb ==Pranala Menarik== * Arduino * ObjectBlocks") |
Onnowpurbo (talk | contribs) |
||
Line 1: | Line 1: | ||
− | [[File:Objectblocks- | + | [[File:Objectblocks-weather-station.png|center|600px|thumb]] |
+ | |||
+ | |||
+ | #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== | ==Pranala Menarik== |
Latest revision as of 22:45, 19 March 2023
#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); }