Difference between revisions of "ObjectBlocks: WeatherStation"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "center|600px|thumb ==Pranala Menarik== * Arduino * ObjectBlocks")
 
 
Line 1: Line 1:
[[File:Objectblocks-weatherstation.png|center|600px|thumb]]
+
[[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

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