Created
October 27, 2017 07:03
-
-
Save ikizoglu/a0ec0918613a4253a3c6af413a08f881 to your computer and use it in GitHub Desktop.
Arduino DHT11 Nem Sensörü Kullanımı
This file contains hidden or 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
| // Yazar: Joseph Dattilo (Virtuabotix LLC) - Version 0.4.5 (11/11/11) | |
| // Kemal İKİZOĞLU | |
| #include <dht11.h> // dht11 kütüphanesini ekliyoruz. | |
| #define DHT11PIN 2 // DHT11PIN olarak Dijital 2"yi belirliyoruz. | |
| dht11 DHT11; | |
| void setup() | |
| { | |
| Serial.begin(9600); // Seri iletişimi başlatıyoruz. | |
| Serial.println("Arduinoturkiye.com DHT11 Test Programi"); | |
| } | |
| void loop() | |
| { | |
| // Bir satır boşluk bırakıyoruz serial monitörde. | |
| Serial.println(); | |
| // Sensörün okunup okunmadığını konrol ediyoruz. | |
| // chk 0 ise sorunsuz okunuyor demektir. Sorun yaşarsanız | |
| // chk değerini serial monitörde yazdırıp kontrol edebilirsiniz. | |
| int chk = DHT11.read(DHT11PIN); | |
| // Sensörden gelen verileri serial monitörde yazdırıyoruz. | |
| Serial.print("Nem (%): "); | |
| Serial.println((float)DHT11.humidity, 2); | |
| Serial.print("Sicaklik (Celcius): "); | |
| Serial.println((float)DHT11.temperature, 2); | |
| Serial.print("Sicaklik (Fahrenheit): "); | |
| Serial.println(DHT11.fahrenheit(), 2); | |
| Serial.print("Sicaklik (Kelvin): "); | |
| Serial.println(DHT11.kelvin(), 2); | |
| // Çiğ Oluşma Noktası, Dew Point | |
| Serial.print("Cig Olusma Noktasi: "); | |
| Serial.println(DHT11.dewPoint(), 2); | |
| // 2 saniye bekliyoruz. 2 saniyede bir veriler ekrana yazdırılacak. | |
| delay(2000); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment