Cov txheej txheem:

Ua Lub Sijhawm Nrog M5stick C Siv Arduino IDE - RTC Lub Sijhawm Tiag Nrog M5stack M5stick-C: 4 Cov Kauj Ruam
Ua Lub Sijhawm Nrog M5stick C Siv Arduino IDE - RTC Lub Sijhawm Tiag Nrog M5stack M5stick-C: 4 Cov Kauj Ruam

Video: Ua Lub Sijhawm Nrog M5stick C Siv Arduino IDE - RTC Lub Sijhawm Tiag Nrog M5stack M5stick-C: 4 Cov Kauj Ruam

Video: Ua Lub Sijhawm Nrog M5stick C Siv Arduino IDE - RTC Lub Sijhawm Tiag Nrog M5stack M5stick-C: 4 Cov Kauj Ruam
Video: Computer Vision with Python! Resizing Images 2024, Hlis ntuj nqeg
Anonim
Image
Image
Yam Koj Xav Tau
Yam Koj Xav Tau

Nyob zoo cov neeg hauv phau ntawv qhia no peb yuav kawm ua lub moos nrog m5stick-C pawg thawj coj loj ntawm m5stack siv Arduino IDE. Yog li m5stick yuav tso tawm hnub, sijhawm & lub hlis ntawm lub hlis ntawm cov zaub.

Kauj Ruam 1: Yam Koj Xav Tau

Rau cov lus qhia no koj yuav xav tau cov hauv qab no:

m5stick-c txoj kev loj hlob board Hom C cable

Kauj Ruam 2: Teeb Arduino IDE

Teeb tsa Arduino IDE
Teeb tsa Arduino IDE

Nco ntsoov tias koj tau teeb tsa ESP32 cov laug cam hauv koj Arduino IDE thiab yog tias nws tsis yog li ntawd, thov ua raws li cov lus qhia hauv qab no kom ua li ntawd: ESP32 BOARDS INSTALL:

Kauj ruam 3: Code

Code
Code

Luam cov cai hauv qab no thiab xa nws mus rau koj lub m5stick-C pawg thawj coj loj: suav nrog "M5StickC.h" RTC_TimeTypeDef RTC_TimeStruct; RTC_DateTypeDef RTC_DateStruct; tsis muaj teeb tsa () {// muab koj teeb tsa teeb tsa ntawm no, kom khiav ib zaug: M5.begin (); M5. Lcd.setRotation (3); M5. Lcd.fillScreen (BLACK); M5. Lcd.setTextSize (1); M5. Lcd.setCursor (40, 0, 2); M5. Lcd.println ("RTC TEST"); RTC_TimeTypeDef TimeStruct; TimeStruct. Hours = 18; TimeStruct. Minutes = 56; TimeStruct. Seconds = 10; M5. Rtc. SetTime (& Lub Sijhawm Tsim Kho); RTC_DateTypeDef DateStruct; DateStruct. WeekDay = 3; DateStruct. Month = 3; DateStruct. Date = 22; DateStruct. Year = 2019; M5. Rtc. SetData (& DateStruct);} void loop () {// muab koj cov cai tseem ceeb ntawm no, kom rov ua dua: M5. Rtc. GetTime (& RTC_TimeStruct); M5. Rtc. GetData (& RTC_DateStruct); M5. Lcd.setCursor (0, 15); M5. Lcd.printf ("Cov ntaub ntawv:%04d-%02d-%02d / n", RTC_DateStruct. Year, RTC_DateStruct. Month, RTC_DateStruct. Date); M5. Lcd.printf ("Lub lis piam: %d / n", RTC_DateStruct. WeekDay); M5. Lcd.printf ("Sijhawm: %02d: %02d: %02d / n", RTC_TimeStruct. Hours, RTC_TimeStruct. Minutes, RTC_TimeStruct. Seconds); ncua (500);}

Kauj Ruam 4: Tau Hnub, Sijhawm & Tsis Muaj Lub Limtiam ntawm Zaub

Image
Image

Tom qab xa cov cai koj tuaj yeem pom cov zaub thiab hnub tim & lub lim tiam ntawm lub hlis yuav raug muab tso rau ntawm cov zaub raws li nws tau qhia hauv kuv cov ntaub ntawv. Yog koj xav pom lub sijhawm ua haujlwm raug ntawm lub moos no thov xa cov vis dis aus muab thiab qhia kuv paub hauv tshooj lus yog tias koj xav qhia dab tsi txog nws.

Pom zoo: