Cov txheej txheem:
- Kauj ruam 1: CircuitPython Code
- Kauj Ruam 2: Txuas TinyLiDAR mus rau Gemma M0
- Kauj ruam 3: Serial Output
Video: CircuitPython thiab TinyLiDAR: Piv Txwv Yooj Yim: 3 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:28
MicroElectronicDesign me meLiDAR yog ST VL53L0X raws lub sijhawm-ntawm-davhlau (ToF) suav nrog cov qauv nrog i2c npav txuas. Adafruit microcontroller boards tau yooj yim txuas nrog lub ntsuas no vim lawv tuaj yeem hais lus i2c raws tu qauv hla lawv cov ntaub ntawv pins.
M0/M4 series muaj qhov zoo dua lwm cov laug cam vim tias lawv txhawb nqa ib pawg ntawm Python uas ua rau cov phiaj xwm nkag tau mus rau cov neeg siv ntau dua li C ntawm Arduino. Nov yog qhov piv txwv yooj yim siv CircuitPython ntawm lub Rooj Tswjhwm Saib Gemma M0 los nyeem qhov kev ntsuas qhov deb ntawm me me LiDAR thiab qhia qhov nrug deb los ntawm qhov sib txawv qhov ci ntawm lub teeb RGB LED. Pawg thawj coj yuav tsum yog M0 version rau kev txhawb nqa nab hab sej.
Nco tseg: Adafruit tseem ua ntau yam kev ntsuas pom kev nrug deb suav nrog ib qho raws VL53L0X.
Kauj ruam 1: CircuitPython Code
- Rub tawm lib/adafruit_dotstar.mpy thiab lib/adafruit_bus_device/i2c_device.mpy yog tias koj tsis muaj lawv. Cov no yog ib feem ntawm kev xaiv lub tsev qiv ntawv pob, saib thawj ntu ntawm CircuitPython I2C rau kev sau ntawv yuav ua li cas rau nruab cov no. Cov ntaub ntawv no yuav tsum mus hauv lib thiab lib/adafruit_bus_device cov npe ntawm Gemma M0.
- Rub tawm gemma-m0-tinylidar-simple.py, hloov nws mus rau main.py thiab luam rau lub hauv paus npe ntawm Gemma M0.
Qhov kev zov me nyuam sau cov ntawv tso tawm rau lub tshuab txuas ntxiv nrog rau qhov sib txawv ntawm qhov ci ci ntawm Gemma MO RGB LED nyob rau hauv kev faib ua feem rau kev nyeem nrug. Lub Gemma M0 coj hloov ntawm ntawm thiab tawm rau nyeem yog li yuav nyem ntawm kwv yees li 5Hz thiab kev coj ua tsis raug ntawm lub me meLiDAR lub rooj tsavxwm yog nyem nws cov xim xiav coj los hais kom ua ntawm 10Hz.
Lub tsheb npav tau tsav ntawm 100kHz uas ua haujlwm zoo rau rooj plaub no. Zoo li txhua lub npav, kev sib txuas lus sib txuas lus nrawm tau txwv los ntawm cov yam ntxwv ntawm cov kab sib kis (s) yog li yuav tsum tau them nyiaj mloog kom ntev, lub peev xwm thiab lwm yam.
Kauj Ruam 2: Txuas TinyLiDAR mus rau Gemma M0
Daim duab qhia tau tias muaj txiaj ntsig tab sis tsis tsim nyog teeb tsa ib ntus los txuas qhov me meLiDAR mus rau Gemma M0 board. Me meLiDAR's "Grove" 4pin tus txuas txuas thoob ntiaj teb tau siv los ntawm Seeed Grove hloov pauv cable, lub taub hau ntsaws thiab cov khej kab txuas los txuas rau Gemma M0. Qee qhov sib cais ntawm cov pins ntawm lub taub hau tshem tawm qhov kev pheej hmoo ntawm qhov tsis raug. Cov kev sib txuas yog:
- Dub: gnd rau gnd
- Liab: +V rau 3Vo
- Dawb: SDA rau D0 (cov ntaub ntawv)
- Daj: SCL rau D2 (moos)
Adafruit cov laug cam muaj qee tus pin uas txhawb nqa i2c cov txheej txheem ua tau zoo hauv kho vajtse. Hauv qhov xwm txheej ntawm Gemma M0, cov no yuav tsum tau siv, D0 rau cov ntaub ntawv thiab D2 rau moos.
Lub tsheb npav i2c xav kom rub tus neeg tawm tsam ntawm cov ntaub ntawv thiab kab kab. Hauv qhov no, qhov me meLiDAR muab qee qhov 4.7K on-board resistors. Yog tias cov no tau raug tshem tawm ntawm Circuit Court los ntawm kev txiav cov kab ces qhov sib npaug yuav tsum tau ntxiv rau hauv Circuit Court.
Kauj ruam 3: Serial Output
Qhov kev zov me nyuam sau qhov tso tawm mus rau lub console txuas qhia qhov ntsuas ntsuas, ntawm no yog qhov piv txwv piv txwv ntawm lub davhlau ya nyob twg qhia qhov khoom txav deb ntawm lub ntsuas cua.
Pom zoo:
D.I.Y YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM LOS NTAWM SCRAPS: 4 Cov Kauj Ruam (nrog Duab)
D.I.Y YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM LOS NTAWM SCRAPS: Hnub no kuv xav qhia yuav ua li cas kom pom lub teeb pom kev zoo los ntawm lub zog xa hluav taws xob tsis siv hluav taws xob los ntawm tus txhuam txhuam hniav thiab lub tshuab solenoid valve coils uas tau khaws los ntawm scrapyard.Ua ntej pib, thov saib cov vis dis aus hauv qab no:
Niaj hnub nimno thiab Tshiab thiab Yooj Yim Piv Txwv Ntawm Cov Xauv Nrog Arduino Matrix Keypad 4x4: 3 Cov Kauj Ruam
Niaj hnub nimno thiab Tshiab thiab Yooj Yim Piv Txwv Ntawm Lub Xauv Nrog Arduino Matrix Keypad 4x4: Lwm qhov piv txwv ntawm kev siv lub LCD keypad matrix 4x4 nrog I2C Circuit Court
IoT Guru Huab - Piv Piv Piv Txwv: 4 Kauj Ruam
IoT Guru Cloud - Piv Txwv Daim Qauv Yooj Yim: IoT Guru Cloud tau muab cov kev pabcuam rov qab los ntawm REST API thiab koj tuaj yeem sib sau cov REST hu rau koj lub vev xaib yooj yim. Nrog Highcharts, koj tuaj yeem tso tawm kab kos ntawm koj qhov kev ntsuas yooj yim nrog AJAX hu
NodeMCU - MQTT Piv Txwv Piv Txwv: 4 Cov Kauj Ruam
NodeMCU - MQTT Piv txwv yooj yim: Zaj lus qhia no yuav qhia qhov pib MQTT raws tu qauv siv ntawm NodeMCU pawg thawj coj saib.Peb siv MQTTBox ua MQTT tus neeg siv khoom ntawm no, thiab peb yuav siv NodeMCU kom ua tiav cov haujlwm hauv qab no: Tshaj tawm "nyob zoo ntiaj teb" rau lub ncauj lus " outTopic”txhua ob vib nas thisSubscr
YUAV UA LI CAS YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM TSHAJ PLAWS YOOJ YIM: 4 Cov Kauj Ruam
YUAV UA LI CAS YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM YOOJ YIM TSHAJ PLAWS: Nyob zoo txhua tus hauv cov lus qhia no kuv yuav qhia koj yuav ua li cas kom yooj yim " SOIL DRYNESS SENSOR ". Qhuav ntawm cov av tau txheeb xyuas siv qhov taw qhia coj. Lub teeb ci wi