Cov txheej txheem:

Kub thiab Vaum Sensor Nrog Arduino thiab Lcd Zaub: 4 Cov Kauj Ruam
Kub thiab Vaum Sensor Nrog Arduino thiab Lcd Zaub: 4 Cov Kauj Ruam

Video: Kub thiab Vaum Sensor Nrog Arduino thiab Lcd Zaub: 4 Cov Kauj Ruam

Video: Kub thiab Vaum Sensor Nrog Arduino thiab Lcd Zaub: 4 Cov Kauj Ruam
Video: Casio G-Shock Mudmaster против Gulfmaster | G Shock GWG-1000 Mudmaster против G Shock GW... 2024, Hlis ntuj nqeg
Anonim
Image
Image

Nyob zoo cov neeg, Txais tos rov qab rau Artuino. Raws li koj tau Pom Kuv tau pib Ua Tus Qhia

Hnub no peb yuav ua qhov ntsuas Kub & Vaum nrog DHT11 tus qauv. Cia peb pib

PS Xav txog Subscribing thiab nyiam cov vis dis aus

Kauj ruam 1: Kev sib txuas

Kev sib txuas
Kev sib txuas

Ua raws daim duab no

tom qab kev sib txuas, nws yuav zoo li qhov no

Kauj ruam 2: Code

Code
Code

Nov yog tus lej uas kuv siv rau kuv qhov project

#include // suav nrog lcd libraryconst int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd (rs, en, d4, d5, d6, d7);

#suav nrog "dht.h" // suav nrog lub tsev qiv ntawv dht sensor

#define DHT_pin A0 // muab lub npe rau tus pin sensor thiab A0

dht DHT; // pib lub sensor

void teeb tsa () {

lcd.begin (16, 2); // initialize the senso

Serial.begin (9600); // pib Serial kev sib txuas lus

ncua (500); // Ncua sijhawm kom cia lub kaw lus khau raj

Serial.println ("DHT11 Vaum & ntsuas kub / n / n");

ncua (1000); // Tos ua ntej nkag mus rau Sensor

}

void voj () {

DHT.read11 (DHT_pin); // Nyeem Sensor tus pin

Serial.print ("av noo ="); // luam tawm cov av noo hauv Serial Monitor

Serial.print (DHT.humidity);

Serial.print ("%");

Serial.print ("kub =");

Serial.print (DHT.temperature); // luam tawm kub ntawm Serial monitor

Serial.println ("C");

lcd.setCursor (0, 0);

lcd.print ("av noo ="); // luam tawm cov av noo ntawm lcd

lcd.print (DHT.humidity);

lcd.print ("%");

lcd.setCursor (0, 2);

lcd.print ("temp ="); // luam tawm qhov kub ntawm lub lcd

lcd.print (DHT.temperature);

lcd.println ("C");

ncua (3000); // Tos 3 vib nas this ua ntej nkag mus rau lub sensor dua.

}

Kauj Ruam 3: Tso Tawm

Tso zis
Tso zis
Tso zis
Tso zis

Kuv sim ntau yam nrog nws.

Thaum kuv tso dej khov nyob ze nws qhov txias txias.

& thiab thaum cua tshuab cua sov rau hauv, qhov kub tau nce

Pom zoo: