Cov txheej txheem:

Kev ntsuas kub thiab av noo Siv OLED Zaub: 5 Kauj Ruam
Kev ntsuas kub thiab av noo Siv OLED Zaub: 5 Kauj Ruam

Video: Kev ntsuas kub thiab av noo Siv OLED Zaub: 5 Kauj Ruam

Video: Kev ntsuas kub thiab av noo Siv OLED Zaub: 5 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Kev ntsuas kub thiab av noo Siv OLED Zaub
Kev ntsuas kub thiab av noo Siv OLED Zaub
Kev ntsuas kub thiab av noo Siv OLED Zaub
Kev ntsuas kub thiab av noo Siv OLED Zaub
Kev ntsuas kub thiab av noo Siv OLED Zaub
Kev ntsuas kub thiab av noo Siv OLED Zaub

Cov ntaub ntawv xav tau-

1. Arduino NANO:

2. DHT11 sensor:

3. OLED zaub:

4. Creadboard:

5. Jumper Wires:

Kev yuav khoom txuas yog rau INDIA nkaus xwb.

Kauj Ruam 1: Daim duab Circuit Court

Daim duab Circuit Court
Daim duab Circuit Court

Tom qab sau tag nrho cov khoom siv xav tau. Rub tawm daim duab kab lus no kom nkag siab zoo dua.

Kauj ruam 2: Pib Txuas

Pib Txuas
Pib Txuas

Muab daim duab hluav taws xob tso rau ntawm koj xub ntiag thiab pib txuas cov xov hlau.

Kauj Ruam 3: Txhim Kho Kev Teeb ntawm Arduino IDE

Kho teeb tsa Arduino IDE
Kho teeb tsa Arduino IDE

Tam sim no, tom qab ua tiav kev sib txuas qhib qhib arduino IDE thiab xaiv koj hom board thiab COM board. Kuj rub tawm thiab suav nrog cov tsev qiv ntawv.

Kauj ruam 4: Code Uploading

Upload Code
Upload Code

Tam sim no, suav thiab xa cov chaws.

CODE:

#include "DHT.h" #include "U8glib.h" U8GLIB_SSD1306_128X64 u8g (U8G_I2C_OPT_NONE | U8G_I2C_OPT_DEV_0);

#define DHTPIN 2

#define DHTTYPE DHT11

DHT dht (DHTPIN, DHTTYPE, 6); kab ntawv [10];

void drawTest (tsis muaj dab tsi) {

u8g.setFont (u8g_font_unifont);

u8g.drawStr (0, 30, "Kub &");

u8g.drawStr (0, 50, "Humidity Meter");

u8g.setFont (u8g_font_helvB08); //

u8g.drawStr (7, 60, "PR ROBOTICS");

}

void teeb tsa () {

dht.begin ();

u8g.firstPage ();

ua {

drawTest ();

}

thaum (u8g.nextPage ());

ncua (3000); }

void voj () {

ncua (500);

ntab h = dht.readHumidity ();

ntab t = dht.readTemperature ();

yog (isnan (h) || isnan (t))

{

rov qab;

}

u8g.firstPage ();

ua {

u8g.setFont (u8g_font_helvB08);

u8g.drawStr (0, 15, "Vaum:");

u8g.drawStr (80, 15, dtostrf (h, 5, 2, str));

u8g.drawStr (120, 15, "%");

u8g.drawStr (0, 30, "Kub:");

u8g.drawStr (80, 30, dtostrf (t, 5, 2, str)); u8g.drawStr (120, 30, "\ 260C");

u8g.drawStr (10, 60, "BY: PR ROBOTICS");

}

thaum (u8g.nextPage ()); }

Kauj ruam 5: Xeem

Kev Xeem
Kev Xeem

Tam sim no, tsuas yog sim koj qhov project.

Pom zoo: