Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Xav Tau
- Kauj ruam 2: Kev sib txuas
- Kauj Ruam 3: Coding Tshooj
- Kauj Ruam 4: Tau Sijhawm
Video: DS1307 Lub Sijhawm Tiag RTC Nrog Arduino: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Hauv phau ntawv qhia no, peb yuav kawm txog Lub Sijhawm Tiag (RTC) thiab yuav ua li cas Arduino & Lub Sijhawm Tiag IC DS1307 tau muab tso ua ke ua lub sijhawm ntsuas.
Lub Sijhawm Tiag (RTC) yog siv rau kev saib xyuas lub sijhawm thiab tswj hwm daim ntawv qhia hnub. Txhawm rau siv RTC, peb yuav tsum xub ua haujlwm nws nrog hnub thiab sijhawm tam sim no. Thaum qhov no ua tiav, RTC cov npe tuaj yeem nyeem txhua lub sijhawm kom paub lub sijhawm thiab hnub tim. DS1307 yog RTC uas ua haujlwm ntawm I2C raws tu qauv. Cov ntaub ntawv los ntawm ntau lub npe tuaj yeem nyeem los ntawm kev nkag mus rau lawv qhov chaw nyob rau kev nyeem ntawv siv I2C kev sib txuas lus.
Kauj Ruam 1: Yam Koj Xav Tau
Nov yog cov hauv qab no koj xav tau rau cov lus qhia no:
Arduino ib
Ds1307 rtc module
Jumper xov hlau
3.7v npib cell
Kauj ruam 2: Kev sib txuas
Thov ua raws qhov txuas schmatics hauv ntu duab thiab txuas txhua yam Raws li schmatics.
Kauj Ruam 3: Coding Tshooj
Programming Arduino los pub RTC nrog hnub thiab sijhawm tam sim no; thiab nyeem hnub thiab sijhawm los ntawm RTC.
Ntawm no, peb yuav siv DS1307 lub tsev qiv ntawv los ntawm Watterott los ntawm GitHub.
Rub lub tsev qiv ntawv los ntawm no.:
Extract lub tsev qiv ntawv thiab ntxiv cov npe hu ua DS1307 rau lub tsev qiv ntawv cov ntawv tais ceev tseg ntawm Arduino IDE.
Thaum lub tsev qiv ntawv tau ntxiv rau Arduino IDE, qhib IDE thiab qhib qhov piv txwv kos npe piv txwv los ntawm DS1307 lub tsev qiv ntawv ntxiv.
Lo Lus Ceeb Toom: Hauv qhov piv txwv piv txwv, hauv teeb lub voj, rtc.set () ua haujlwm tau siv. Dhau hnub tam sim no thiab sijhawm sib cav raws li tau hais rau txoj haujlwm no. Hauv qhov piv txwv kos duab, nqe lus no yuav muab los tham. Uncomment nws thiab upload daim duab. Thaum cov duab kos tau rub tawm, tsis pom zoo cov lus hais ntxiv thiab rub cov duab kos. Yog tias qhov no tsis ua tiav, txhua lub sijhawm Arduino UNO pawg thawj coj saib rov pib dua lossis tau qhib lub zog tom qab tua hluav taws, hnub thiab sijhawm uas koj tau teeb tsa yuav raug teeb tsa ntau zaus thiab koj yuav tsis tuaj yeem nyeem lub sijhawm tam sim no thiab hnub tim.
/* DS1307 RTC (Sijhawm Sijhawm-Sijhawm) Piv txwv
Uno A4 (SDA), A5 (SCL) Mega 20 (SDA), 21 (SCL) Leonardo 2 (SDA), 3 (SCL) */
#suav nrog "Wire.h"
#suav nrog "DS1307.h"
DS1307 rtc;
void teeb () { /*init Serial chaw nres nkoj* / Serial.begin (9600); thaum (! Serial); /*tos rau qhov chaw nres nkoj txuas mus txuas - xav tau rau Leonardo nkaus xwb*/
/*init RTC*/ Serial.println ("Init RTC …");
/*tsuas yog teem hnub+sijhawm ib zaug*/ rtc.set (0, 0, 8, 24, 12, 2014); /*08: 00: 00 24.12.2014 // sec, min, teev, hnub, hli, xyoo*/
/*nres/ncua RTC*/// rtc.stop ();
/*pib RTC*/ rtc.start (); }
void loop () {uint8_t sec, min, teev, hnub, hli; uint16_t xyoo;
/*tau sijhawm los ntawm RTC*/ rtc.get (& sec, & min, & teev, & hnub, & hli, & xyoo);
/*serial output*/ Serial.print ("\ nTime:"); Serial.print (teev, DEC); Serial.print (":"); Serial.print (min, DEC); Serial.print (":"); Serial.print (sec, DEC);
Serial.print ("\ n Hnub tim:"); Serial.print (hnub, DEC); Serial.print ("."); Serial.print (hli, DEC); Serial.print ("."); Serial.print (xyoo, DEC);
/*tos ib pliag*/ ncua (1000); }
Luam cov cai saum toj no & xa nws mus rau koj li Arduino Board
Kauj Ruam 4: Tau Sijhawm
Tom qab txuas txhua yam ua ke thiab xa cov cai mus rau koj lub rooj tsav xwm arduino, qhib qhov saib hauv ntu hauv koj lub tswv yim arduino thiab tom qab ntawd koj yuav tuaj yeem tau txais hnub tim & sijhawm raws li kuv hauv koj li kev saib xyuas raws li koj tuaj yeem pom kuv tuaj yeem pom kuv Lub Sijhawm & hnub tim hauv kuv qhov kev saib xyuas, rau qhov tso tawm qhov tseeb thov xa cov duab saum toj no thiab muaj kev lom zem ntxiv RTC moos rau koj qhov project.
Pom zoo:
Lub Sijhawm Tiag Tiag Tiag Tiag Tiag Paub Siv EM Hneev Taw: 6 Kauj Ruam
Kev Pom Zoo Lub Sijhawm Tiag Tiag Siv EM Cov Hneev Taw: Cov cuab yeej no yog txhawm rau faib cov khoom siv hluav taws xob sib txawv raws li lawv cov cim EM. Rau cov cuab yeej sib txawv, lawv muaj cov cim sib txawv EM tawm los ntawm nws. Peb tau tsim kev daws teeb meem IoT txhawm rau txheeb xyuas cov khoom siv hluav taws xob siv Particle
Lub kaus mom tsis yog lub kaus mom - Cov kaus mom rau cov neeg uas tsis tau hnav lub kaus mom tiag tiag, tab sis xav tau lub kaus mom kev paub: 8 Kauj Ruam
Lub kaus mom tsis yog lub kaus mom rau cov tib neeg uas tsis tau hnav lub kaus mom tiag tiag, tab sis xav tau lub kaus mom kev paub: Kuv ib txwm xav tias kuv tuaj yeem yog tus neeg lub kaus mom, tab sis tsis tau pom dua lub kaus mom uas ua haujlwm rau kuv. Qhov no "Hat Not Hat," lossis fascinator raws li nws tau hu ua yog txheej txheej sab saum toj rau kuv cov teeb meem lub kaus mom uas kuv tuaj yeem koom nrog Kentucky Derby, vacu
Siv DS1307 thiab DS3231 Lub Sijhawm Teev Sijhawm Sijhawm Nrog Arduino: 3 Kauj Ruam
Siv DS1307 thiab DS3231 Lub Sijhawm Caij Nyoog Sijhawm Nrog Arduino: Peb tseem tau txais kev thov yuav siv DS1307 thiab DS3231 lub sijhawm teev sijhawm nrog Arduino los ntawm ntau qhov chaw-yog li qhov no yog thawj ntawm ob ntu kev qhia yuav siv li cas. Txog qhov kev qhia Arduino no peb muaj ob lub sijhawm teev sijhawm ua haujlwm rau peb
Arduino Raws Lub Sijhawm Siv DS1307 Lub Sijhawm Tiag (RTC) Module & 0.96: 5 Cov Kauj Ruam
Arduino Raws Lub Sijhawm Siv DS1307 Lub Sijhawm Tiag (RTC) Module & 0.96: Nyob zoo cov menyuam hauv qhov kev qhia no peb yuav pom yuav ua li cas thiaj ua lub moos ua haujlwm siv DS1307 lub sijhawm teev sijhawm & Yog li peb yuav nyeem lub sijhawm los ntawm lub moos module DS1307. Thiab luam tawm ntawm lub vijtsam OLED
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 Sijhawm Nrog M5stack M5stick-C: Nyob zoo cov neeg hauv phau ntawv qhia no peb yuav kawm paub yuav ua li cas thiaj ua lub moos nrog m5stick-C txhim kho pawg thawj coj ntawm m5stack siv Arduino IDE.So m5stick yuav tso tawm hnub, sijhawm & lub lim tiam ntawm lub hlis ntawm cov zaub