Last active
September 8, 2020 09:52
-
-
Save ajangrahmat/2db04d8d043472f3f8787a4058f40ee4 to your computer and use it in GitHub Desktop.
Program Untuk Baca Suhu dan Kelembaban pada Sensor DHT11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <DHT.h> | |
DHT dht(2, DHT11); //Pin, Jenis DHT | |
void setup(){ | |
Serial.begin(9600); | |
dht.begin(); | |
} | |
void loop(){ | |
float kelembaban = dht.readHumidity(); | |
float suhu = dht.readTemperature(); | |
Serial.print("kelembaban: "); | |
Serial.print(kelembaban); | |
Serial.print(" "); | |
Serial.print("suhu: "); | |
Serial.println(suhu); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment