Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
aiawasdctrl
Published © GPL3+

Menegtahui suhu

Dapat mencari tahu suhu sebuah ruangan

BeginnerFull instructions provided1 hour221
Menegtahui suhu

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1

Software apps and online services

Arduino IDE
Arduino IDE
ThingSpeak API
ThingSpeak API

Story

Read more

Code

suhu

C/C++
#include "DHT.h"
#define DHTpin 4
#define DHTTYPE 11

DHT dht(4, DHT11);  //pin D1

void setup(){
  Serial.begin(9600);
  dht.begin();
}

void loop()
{ 
  float h = dht.readHumidity();
  float t = dht.readTemperature(); 
  Serial.print(F("Humidity: "));
  Serial.print(h);
  Serial.print("\n");
  Serial.print(F("  Temperature: "));
  Serial.print(t);
  Serial.print(F("°C "));
  delay(2000);
}

Credits

aiawasdctrl
6 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.