Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Teeb Koj Arduino IDE los Txhawb ESP32
- Kauj Ruam 2: Txuas lub LED Matrix rau ESP32
- Kauj Ruam 3: Muab Nws Ua Ke
- Kauj Ruam 4: Arduino IDE thiab INO File
- Kauj ruam 5: Txoj Cai
Video: ESP32 Scrolling WordClock ntawm LED Matrix: 5 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Hauv qhov haujlwm no kuv tsim Scrolling WordClock nrog ESP32, LED Matrix thiab lub thawv luam yeeb.
WordClock yog lub moos uas sau lub sijhawm ntau dua li tsuas yog luam tawm ntawm lub vijtsam lossis muaj tes uas koj tuaj yeem nyeem. Lub moos no yuav qhia koj tias nws yog 10 feeb dhau los 3 teev tsaus ntuj, lossis tav su. Kuv tseem tau npaj nws los siv Prevening (los ntawm Big Bang Theory) lub npe rau qhov tsis meej pem ntawm lub sijhawm nruab nrab ntawm yav tav su thiab yav tsaus ntuj. Pib 4:00 PM.
ESP32 zoo heev, lawv lom zem heev thiab tsis kim li, Yog tias koj nyiam programming Arduino koj yuav xav tsis thoob li cas ntawm ESP32 tuaj yeem ua rau qis dua $ 10. Lawv siv Arduino IDE thiab yooj yim rau txoj haujlwm. Kuv yuav ua kom pom yuav ua li cas hauv qhov kev qhia no.
Khoom siv
- ESP32 - ncig $ 10 ntawm amazon
- LED Matrix (max7219) (thiab xov hlau) - $ 9 amazon
- Cigar lub thawv
- USB fais fab cable
- Yeem 3d tshuab luam ntawv rau esp32 sawv ntsug
Kauj Ruam 1: Teeb Koj Arduino IDE los Txhawb ESP32
Tau txais Arduino IDE:
- Hauv qhov browser mus rau
- Nyem rau Software ces rub tawm kom tau ARDUINO 1.8.12
Ntxiv ESP32 Txhawb rau koj Arduino IDE:
- Pib Arduino IDE
- Nyem rau ntawm File Menu ces Nyiam.
Ib zaug hauv "Nyiam" ntxiv cov chaw tsim khoom txhawb los ntawm kev ntxiv kab hauv qab no mus rau "Tus Thawj Saib Xyuas Haujlwm Ntxiv"
dl.espressif.com/dl/package_esp32_index.js
Qhov no yuav ua rau peb nkag mus ntxiv lub rooj tsav xwm rau IDE
Mus rau Cov Ntawv Qhia Cov Cuab Yeej thiab tom qab ntawv Boards thiab mus rau tus thawj tswj hwm pawg thawj coj saib
Nrhiav tom ntej rau "ESP" thiab ntxiv pob los ntawm Expressif.
Thaum kawg peb xav rov qab mus rau "Cov Cuab Yeej" Ntawv Qhia, tom qab ntawd "Pawg Thawj Coj" dua thiab nqes mus kom pom koj li ESP32 lub cuab yeej.
Kuv yog "ESP32 Wrover Module"
Kauj Ruam 2: Txuas lub LED Matrix rau ESP32
LED matrix yog ua los ntawm plaub 8x8 blocks ntawm LEDs thiab siv MAX7219 nti. Qhov ntawd muab rau peb 8x32 LEDs hauv Matrix lossis 256 LEDs !!!.
Esp32 tau zaum ntawm qhov tuav kuv tsim hauv TinkerCad. Kuv tus tuav tuav lub pins tig ntsej muag kom koj tuaj yeem txuas cov xov hlau.
LED Matrix txuas rau ESP32 siv SPI (Serial Peripheral Interface).
Siv Poj Niam/Poj Niam Hluav Taws Xob thiab Txuas tus pin raws li hauv qab no:
- ESP32 - 5v rau VCC ntawm Matrix
- ESP32 - GND rau GND ntawm Matrix
- ESP32 - PIN5 (G5) rau CS ntawm Matrix
- ESP32 - PIN23 (G23) rau Din ntawm Matrix
- ESP32 - Tus Pin 18 (G18) rau CLK ntawm Matrix
Nws tuaj yeem siv lwm tus pin lossis yog tias koj ESP32 muaj qhov sib txawv pinout.
Kauj Ruam 3: Muab Nws Ua Ke
Tom ntej no kuv txiav lub thawv luam yeeb kom muab qhov chaw rau kuv tso rau hauv LED zaub. Lub thawv yog mos thiab kuv muaj peev xwm siv rab chais rab riam. Tom qab ntawd kuv tau xuab zeb kom du nws.
Kuv kuj txiav tag nrho hauv nraub qaum rau lub hwj chim qaum. Kuv nyuam qhuav siv USB zog. Kuv tuaj yeem tau ntxiv ib lub xov tooj USB them roj teeb sab hauv lub thawv cigar yog tias kuv xav kom nws ua wireless.
Kauj Ruam 4: Arduino IDE thiab INO File
Qhov zoo tshaj yog qhov chaws. Tab sis ua ntej peb yuav tsum ntxiv lub tsev qiv ntawv los tso cai rau qhov program kom siv cov zaub hauv txoj hauv kev yooj yim dua. Kuv ntxiv MD_MAX72xx lub tsev qiv ntawv.
Txhawm rau ntxiv lub tsev qiv ntawv nyem rau ntawm "Sketch" ntawv qhia zaub mov, tom qab ntawd "suav nrog Lub Tsev Qiv Ntawv" thiab "Tswj Cov Tsev Qiv Ntawv" qhov no yuav thauj khoom thiab tso cai rau koj tshawb nrhiav MD_MAX72xx lub tsev qiv ntawv. Tsuas yog nyem rau nruab thiab koj muaj nws.
Tom ntej no tau txais kuv Arduino INO Cov Ntaub Ntawv:
github.com/aapicella/wordClock/blob/master/Word_Clock_LED_NTP_final_.ino
Thauj cov ntaub ntawv ino rau hauv koj Arduino IDE, Txuas lub USB los ntawm ESP32 rau koj lub computer.
Nyem rau ntawm "Sketch" ces Upload
Txog tam sim no lub moos yuav tsis ua haujlwm, ESP32 yuav tsis tso saib dab tsi. Vim li cas? peb yuav tsum ntxiv koj li WIFI rau cov cai vim tias WordClock txuas rau hauv internet kom tau txais lub sijhawm. Yog lawm … cov kauj ruam tom ntej ->.
Kauj ruam 5: Txoj Cai
Thaum kawg peb ua nws rau qhov kuv nyiam tshaj. Qhov kev zov me nyuam. Kuv yuav npog nws los ntawm sab saum toj mus rau hauv qab yog tias koj xav tau, Kom tau txais txoj haujlwm los ua haujlwm nrog koj li internet hauv tsev koj tsuas yog xav hloov cov kab no.
// Ntxiv koj cov ntaub ntawv network
const char *ssid = "xxxxxx";
const char *password = "xxxxxx";
Qhov kev zov me nyuam yog qhov nyuaj, tab sis lom zem heev.
Txhawm rau lov tes taw "Prevening" tsuas yog hloov tus nqi rau qhov tsis raug:
const boolean PREVENING = muaj tseeb; // Big Bang txoj kev xav.
Txhawm rau lov tes taw tso saib lub sijhawm digital tom qab scrolling hloov qhov no mus tsis tseeb.
const boolean DISPLAY_DIGITAL = muaj tseeb; // tig rau tso saib cov sijhawm digital tom qab scrolling.
Scrolling Lub Sijhawm:
Kuv tau txais lub sijhawm los ntawm lub sijhawm server hauv internet siv NTP (Network Time Protocol). Lub sijhawm muaj nyob hauv qhov sib txawv hu ua timeinfo thiab peb tau txais teev thiab feeb los ntawm nws
int teev = timeinfo.tm_hour; /// 0-23
int feeb = timeinfo.tm_min; // 0-59
Txheeb xyuas tom ntej AM lossis PM
Nws AM yog teev <12
Kuv tsim txoj hlua hu ua "theTime" thiab pib nrog:
theTime = "Nws yog";
Kom tau tus lej raws li cov lus, Kuv tau tsim kab lus ntawm cov lej rau 30
const char *lej = {
"0", "Ib", "Ob", "Peb", "Plaub", "Tsib", "Rau", "Xya", "Yim", "Cuaj", "Kaum", "Kaum Ib", "Kaum Ob" "," Kaum Peb "," Kaum Ib "," Peb Hlis "," Kaum Ib "," Kaum Ib "," Kaum Ib "," Kaum Hli "," Nees nkaum "," Nees nkaum Ib "," Nees nkaum-Ob "," Nees nkaum-Peb " "," Nees nkaum-Plaub "," Nees nkaum-Tsib "," Nees nkaum-Rau "," Nees nkaum-Xya "," Nees nkaum-Yim "," Nees nkaum-Nine "," Ib nrab dhau los "};
Yog li thaum nws 12:05 lossis tsib feeb dhau los kaum ob nws tiag tiag rau Arduino
tus lej [5] feeb dhau los tus lej [12]
Txhawm rau txiav txim siab yog tias nws "Minutes Past" lossis "Minutes To" peb tsuas yog saib cov feeb. Yog tias feeb yog <31 nws yog "Minutes Past" yog tias cov feeb ntau dua 31 peb siv "Minutes To" tab sis siv tus lej [60-feeb] yog li 12:50 yuav yog 60-50 feeb lossis tus lej [10] uas yuav muab peb 10 feeb Mus Rau 12 0'clock.
Tau kawg muaj lwm txoj cai zoo li ntawm 15, 30, 45 peb tsis siv feeb nws tsuas yog ib nrab dhau los lossis peb lub hlis rau, thiab yog tias feeb yog 0 lub sijhawm tsuas yog "Kaum Teg" lossis tav su.
Yog li txhawm rau muab tso ua ke, Kuv txuas ntxiv txhua yam khoom mus rau Txoj hlua Lub Sijhawm tom qab ntawd tso nws tawm ntawm LED Matrix. Kuv siv pawg Yog tias nqe lus. Tej zaum kuv yuav tsum tau siv rooj plaub tab sis nws tsuas yog yooj yim dua kom ntxiv lawv.
Rau peb tus piv txwv 12:05
theTime = "Nws yog"
yog feeb <31 siv "Minutes Past" txwv tsis pub nws "Minute To"
theTime + = tus lej [5] + "Minutes Past" + tus lej [12] + "O'Clock" // Nco tseg: Cov cim + + = yog ntxiv.
Tom ntej no peb saib lub sijhawm los txiav txim seb nws puas sawv ntxov, yav tav su lossis yav tsaus ntuj.
theTime+= "Yav tsaus ntuj"
Txoj hlua kawg mus rau qhov sib piv yog:
"Nws yog Tsib feeb dhau los kaum ob teev nyob rau yav tsaus ntuj"
Txoj haujlwm no lom zem heev los sau. Yog tias koj nyiam nws thov nyem Lub Plawv thiab Pov Ntawv rau kuv thov.
Pom zoo:
Cov Duab Duab Duab thiab Cov Duab 1: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Cubes thiab Cov Duab 1: Thaum sim nrog qee cov ntoo ntoo thiab cov duab los qhia, kuv pom ob peb txoj hauv kev los ua cov voos thiab lwm yam duab los ntawm cov khoom siv yooj yim. Los ntawm kev muab cov no los ua Cov Ntawv Qhia, Kuv vam tias yuav txhawb nqa kev ua si thiab kev kawm. Kev hloov pauv ntawm qhov kev qhia no
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: Nov yog txoj hauv kev yooj yim heev thiab tus nqi qis mus rau cov duab thav duab digital - nrog qhov zoo ntawm kev ntxiv /tshem cov duab hla WiFi ntawm 'nyem thiab luag' siv (pub dawb) xa cov ntaub ntawv . Nws tuaj yeem siv tau los ntawm qhov me me £ 4.50 Pi Zero. Koj tseem tuaj yeem hloov pauv
Kev tswj hwm tus kheej ntawm RPM ntawm Lub Cav Siv Lub Tswv Yim Los Ntawm IR Raws Li Tachometer: 5 Cov Kauj Ruam (nrog Duab)
Kev Tswj Tus Kheej ntawm RPM ntawm Lub Cav Siv Lub Tswv Yim Los Ntawm IR Raws Lub Tachometer: Muaj ib txwm xav tau rau kev siv tshuab txheej txheem, ua nws yooj yim/tsis txaus ntseeg. cov txheej txheem rau dej/siv dej rau peb daim av me me.Qhov teeb meem ntawm tsis muaj kab khoom siv tam sim no
Zaub Cov Duab Tawm ntawm PSP/Lub Xov Tooj Ntawm Lub Xov Tooj Ntawm Digital Duab: 3 Kauj Ruam
Zaub Cov Duab Tawm PSP/Lub Xov Tooj Ntawm Lub Xov Tooj Ntawm Tus Duab: Zoo … lub npe hais tias txhua yam tiag tiag … Qhov no yog qhov qhia tau yooj yim heev thiab nws tsis xav tau kho vajtse lossis software ntau dua li koj yuav tsum muaj ! Cov Lus Nug Qhia Rau Kuv lossis Tawm Tswv Yim! Koj tsis tas yuav hloov kho kom ua
Cov lus qhia ntawm Kev Ua Kom Zoo Mock-Up ntawm Track Slide Tsim rau Nqa/Txo Hauv Pem Hauv Ntej-Mounted Footrests ntawm Lub Hwj Huam Log: 9 Kauj Ruam (nrog Duab)
Cov lus qhia ntawm Kev Ua Kom Tiav Mock-Up ntawm Track Slide Tsim rau Nqa/Sab Qaum Nruab Nrab-Mounted Footrests ntawm Lub Hwj Huam Lub Rooj Zaum: Lub hauv paus tau teeb tsa lub tog zaum kom nqa tau hauv qab lub rooj kom zoo, thiab qis dua kom siv tau. Ib lub tswv yim rau kev ua haujlwm ywj pheej ntawm kev tuav cov footrest thiab kev xa tawm tsis suav nrog lub rooj zaum fais fab lag luam, thiab PWC cov neeg siv tau qhia txog qhov xav tau