Cov txheej txheem:

Arduino Matrix Moos: 6 Kauj Ruam
Arduino Matrix Moos: 6 Kauj Ruam

Video: Arduino Matrix Moos: 6 Kauj Ruam

Video: Arduino Matrix Moos: 6 Kauj Ruam
Video: Tesla Cybertruck Crash Test - BeamNG.Drive #shorts 2024, Hlis ntuj nqeg
Anonim
Arduino Matrix Moos
Arduino Matrix Moos

Nqe lus piav qhia:

Tsim koj lub moos siv Arduino, cov duab matrix, thiab Lub Sijhawm Tiag Tiag (RTC). Nov yog qhov haujlwm lom zem thiab yooj yim uas kuv xav tias yog qhov zoo rau cov pib tshiab. Lub moos siv tus qauv RTC txhawm rau txheeb xyuas lub sijhawm nrog rau hnub, hli, thiab xyoo. Ib qho ntxiv, tus qauv muaj lub ntsuas kub hauv lub ntsuas. Koj tuaj yeem kawm paub ntau ntxiv txog DS3231 tus qauv ntawm no nrog rau I2C tsheb npav sib txuas lus siv rau nws ntawm no. Thaum kawg peb yuav siv Dot Matrix Display rau qhov tseeb, tso saib lub sijhawm, hnub ntawm lub lim tiam, hli.etc. Koj tuaj yeem paub ntau ntxiv txog cov zaub ntawm no thiab MAX7219 IC tsav tsheb hauv cov ntawv teev hauv qab no.

Koj tseem tuaj yeem rub tawm cov ntawv pdf rau qhov haujlwm no ntawm no. Nws zoo ib yam li cov lus qhia no.

[Hloov kho: 2/22/19] Tsis txhob siv phau ntawv pdf, Kuv tau hloov kho cov lus qhia no tab sis cov kev hloov pauv tseem tsis tau pom dua ntawm pdf.

Kauj Ruam 1: Sib Sau Ua Ke

Cov cheebtsam koj yuav xav tau rau txoj haujlwm no:

  • Max7219 Dot Matrix Zaub [Yuav ntawm no] [Cov Ntaub Ntawv]
  • RTC DS3231 [Yuav khoom ntawm no] [Cov Ntaub Ntawv]
  • 3V CR3032 roj teeb (rau DS3231)

Ib qho ntxiv, koj yuav xav tau Arduino ntawm txhua yam (tshwj xeeb tshaj yog Nano kom txo qhov loj ntawm txoj haujlwm), lub khob cij, cov xov hlau txuas nrog rau Arduino IDE teeb tsa hauv koj lub PC.

Kauj ruam 2: Tsev qiv ntawv

Tsev qiv ntawv
Tsev qiv ntawv

Rub tawm cov tsev qiv ntawv hauv qab no thiab teeb tsa.zip cov ntaub ntawv mus rau Arduino IDE los ntawm kev mus rau Sketch> suav nrog Tsev qiv ntawv> Ntxiv. Zip tsev qiv ntawv

NCO TSEG: VERSIONS MATTER !

* Txheeb xyuas tias koj muaj qhov tseeb ua ntej rub tawm. Kuv xav kom rub tawm txhua lub tsev qiv ntawv hauv Arduino IDE kom nyob nyab xeeb.

MD_Parola 3.0.1:

MD_MAX72XX 3.0.2:

DS3231 1.0.2:

Xwb, Hauv Arduino IDE mus rau Sketch> suav nrog Tsev Qiv Ntawv> Tswj Tsev Qiv Ntawv thiab hauv hom tshawb fawb bar: “MAX72XX” thiab koj yuav tsum pom cov hauv qab no (Saib duab):

Nruab tsuas yog MD_MAX72XX thiab MD_Parola. MD_MAXPanel tsis xav tau.

Kauj Ruam 3: Xeem Koj Cov Cheeb Tsam

Tom qab Txhim kho cov tsev qiv ntawv, sim koj cov khoom ib tus zuj zus kom ntseeg tau tias lawv ua haujlwm zoo li lawv yuav tsum tau ua. Thov ua raws cov theem no ua ntej txuas txhua yam ua ke

Txhawm rau ntsuas DS3231 RTC Module, Txuas DS3231 rau Arduino (saib Cov Xov Xwm hauv qab no). Tom qab ntawd hauv Arduino IDE, mus rau Cov Ntaub Ntawv> Piv txwv> DS3231> DS3231_Test thiab xa cov duab kos. Qhib Serial Monitor thiab txheeb xyuas kom pom tias koj tau txais hnub raug, lub sijhawm, hnub.etc.

Txhawm rau ntsuas cov duab matrix, xub txuas nws mus rau Arduino (saib Cov Xov Xwm hauv qab no). Tom ntej no, hauv Arduino IDE, mus rau Cov Ntaub Ntawv> Piv Txwv> MD_Parola> Parola_HelloWorld thiab xa cov duab kos. Koj yuav tsum pom HELLO luam tawm ntawm cov zaub thiab nws yuav lossis tsis tuaj yeem luam rov qab. Yog tias cov ntawv rov qab ces koj yuav tsum hloov kab hauv qab no:

#define HARDWARE_TYPE MD_MAX72XX:: PAROLA_HW

Rau

#define HARDWARE_TYPE MD_MAX72XX:: FC16_HW

Rub tawm daim duab dua thiab teeb meem yuav tsum raug daws.

Tam sim no uas peb tau sim peb cov khoom, peb npaj tau xaim txhua yam ua ke!

Kauj ruam 4: Kev thaiv kab

Thaiv
Thaiv
Thaiv
Thaiv
Thaiv
Thaiv

Xa mus rau daim duab lossis kab kos lossis rooj

Kauj ruam 5: CODE

Tau txais cov cai ntawm no

Nco tseg: Kuv siv tus lej ib txwm los ntawm Cov Hluav Taws Xob Cov Hluav Taws Xob tab sis hloov kho nws los txhawb tam sim no (thaum lub sijhawm ua tiav) cov tsev qiv ntawv.

Nta Nta:

Lub moos tau teeb tsa los qhia lub sijhawm hauv 24 teev hom ntawv tab sis nws tuaj yeem hloov pauv tau yooj yim rau 12 teev. Lub moos tseem yuav ntsuas qhov ntsuas kub (ob qho tib si hauv Celsius thiab Fahrenheit). Kuv kuj tau suav nrog qhov tshwj xeeb hu ua 'Sleep Mode' uas tau teeb tsa rau "OFF" (Saib Hom Pw tsaug zog hauv qab no kom paub meej).

12 teev Hom: Txhawm rau teev sijhawm qhia lub sijhawm hauv 12 teev hom ntawv, koj yuav tsum tau tawm tswv yim kab 88

teev = Clock.gethour (h12, PM); // 24 teev Format

Thiab tsis pom zoo kab 93 txog 100

yog (Clock.getHour (h12, PM)> = 13 || Clock.getHour (h12, PM) == 0)

{h = Clock.getHour (12, PM) - 12; } lwm {h = Clock.getHour (h12, PM); }

Pw tsaug zog hom:

Nov yog qhov tshwj xeeb uas pab txo qis lub teeb ci ntsa iab tshwj xeeb tshaj yog nyob rau lub sijhawm uas peb tsaug zog. Kuv tsis xav tias koj xav sawv thaum ib tag hmo thiab dig muag los ntawm lub moos no. Nws ci heev txawm tias thaum nws nyob ntawm qhov chaw qis tshaj. Txhawm rau pab kom tsaug zog hom, tsis ua raws kab 177 txog 184

yog (h == 12 || h <8) // Lub sijhawm ua ntu zus (qhov no, txij 12 teev sawv ntxov txog 8 teev tsaus ntuj) {P.setIntensity (0); // Teeb tsa lub teeb ci rau qhov qis tshaj} lwm qhov {P.setIntensity (6); // Teeb tsa lub teeb ci rau 6 (15 yog qhov ci tshaj)}

Nco tseg: Kuv tau hla qhov teeb meem thaum siv hom pw tsaug zog thaum lub moos tau teeb tsa rau 12 teev hom. Koj yuav pom tias nws yuav ua haujlwm ob zaug ib hnub txij li thaum 8 teev sawv ntxov thiab 8 teev tsaus ntuj tau txhais ob qho tib si li 8. Yog li yog tias koj teeb tsa Pw Hom kom nquag los ntawm 9 teev tsaus ntuj txog 7 teev sawv ntxov, tom qab ntawd nws tseem yuav ua haujlwm thaum 9 teev sawv ntxov txog 7 teev tsaus ntuj. YUAV UA LI CAS, qhov teeb meem no tsis tshwm sim yog tias lub moos tau teeb tsa rau 24 teev.

Kauj Ruam 6: Xaus

Nrog koj zoo siab !!! Koj muaj lub moos ua haujlwm. Nov yog qhov kuv tau muab tawm [Clock Gallery]. Kuv vam tias koj tsis tsuas yog kawm me ntsis ntxiv txog cov khoom siv thiab cov cim, tab sis koj tau txaus siab rau txoj kev taug mus rau qhov ntawd. Thov qhia rau kuv nrog koj cov kev xav ntawm phau ntawv qhia no ntawm [email protected] Qhov no yog qhov tseeb kuv thawj qhov haujlwm qhia thiab vam tias nws tau pab koj zoo. Kuv vam tias yuav tsim ntau cov lus qhia ntxiv. Ib qho ntxiv, yog tias koj muaj lus nug, tawm tswv yim, thiab/lossis kev txhim kho ntawm txoj haujlwm, thov hu tuaj rau kuv.

Pom zoo: