من کد زیر را برای این کار استفاده کردم اما خروجی اشتباه می گیرم، مشکل کار کجاست؟کد:// include the library code: #include <LiquidCrystal.h> #include "DHT.h" #define DHTPIN 2 // what digital pin we're connected to #define DHTTYPE DHT11 // DHT 11 DHT dht(DHTPIN, DHTTYPE); // تعیین این که نمایشگر به چه پایه هایی از بردمون وصل هستش // LiquidCrystal(rs, rw, enable, d4, d5, d6, d7) LiquidCrystal lcd(11,10,9,4,5,6,7); void setup() { Serial.begin(9600); lcd.println("DHT11 testing!"); dht.begin(); //تعیین تعداد سطر و ستون های نمایشگرمون lcd.begin(20, 4); //تعیین موقعیت نمایش گر برا نمایش اطلاعات lcd.setCursor(3,1); // نمایش یه متن رشته ای lcd.print("Wellcome"); delay(3000); lcd.clear(); lcd.print("WATER CREATOR"); delay(3000); lcd.clear(); lcd.autoscroll(); lcd.setCursor(10,0); for(int i=0 ; i<=9 ; i++) { lcd.print(i); delay(500); } delay(2000); lcd.clear(); lcd.noAutoscroll(); for(int i=0 ; i<=9 ; i++) { lcd.print(i); delay(500); } } void loop() { // Wait a few seconds between measurements. delay(2500); // Reading temperature or humidity takes about 250 milliseconds! // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) float h = dht.readHumidity(); // Read temperature as Celsius (the default) float t = dht.readTemperature(); // Read temperature as Fahrenheit (isFahrenheit = true) float f = dht.readTemperature(true);// temperature in F lcd.print("Humidity:"); lcd.print(h); lcd.print(" %\t"); lcd.print("Temperature: "); lcd.print(t); lcd.print(" *C "); lcd.print(f); lcd.print(" *F\t"); lcd.print("Heat index: "); // lcd.print(hic); // lcd.print(" *C "); // lcd.print(hif); //lcd.println(" *F"); // Check if any reads failed and exit early (to try again). if (isnan(h) || isnan(t) || isnan(f)) { lcd.print("Failed to read from DHT sensor!"); return; } // Compute heat index in Fahrenheit (the default) float hif = dht.computeHeatIndex(f, h); // Compute heat index in Celsius (isFahreheit = false) float hic = dht.computeHeatIndex(t, h, false);// if false shows C if true shows F }


LinkBack URL
About LinkBacks



پاسخ با نقل قول
