Cov txheej txheem:
- Kauj Ruam 1: Sau tag nrho Txhua Qhov
- Kauj ruam 2: Txuas
- Kauj Ruam 3: Nthuav Tawm Pob Python
- Kauj Ruam 4: Txhim Kho Cov Piv Txwv
- Kauj ruam 5: Pab kom I2C
- Kauj Ruam 6: Khiav Calibratethresholds
- Kauj ruam 7: Hloov kho thiab Tom qab ntawd Nyem Readkeypadwithtimeout
- Kauj Ruam 8: Yuav Ua Li Cas Ib Tus Pin Keypad Ua Haujlwm
- Kauj Ruam 9: Xaus
Video: Ib Tus Pin Keypad Raspberry Pi Siv Qhia: 9 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
DISCLAIMER: Qhov no yog kev qhia siv rau QHOV QHOV QHOV ZOO TSHAJ PLAWS ZOO TSHAJ PLAWS: Ib tus lej KEYPAD. Qhov no tsis yog DIY PROJECT. Yog tias koj xav ua tus thawj coj koj tus kheej, EAGLE FILES tuaj yeem nrhiav tau thaum kawg ntawm TUTORIAL
Dab tsi yog Ib Tus Pin Keypad?
Ib Tus Pin Keypad ua rau siv tus lej lej lej kom yooj yim dua thiab cia koj khaws koj cov ntawv I/O uas muaj nqi rau lwm lub hom phiaj. 16 lub pob matrix keypad feem ntau xav tau 8 lub tswv yim digital ntawm lub microcontroller lossis ib lub computer board. Cov neeg nyiam tshaj plaws Arduinos txwv koj tsuas yog 14 tus lej digital, yog li 16-lub pob keypad tso koj nrog tsuas yog 6 tus pin rau qhov seem ntawm koj txoj haujlwm. Cov peev txheej-qhov tsis txaus no yuav ua rau kev tsim tus nqi pauv pauv lossis tus nqi kim dua kev tswj hwm tus tswj. Qhov One Pin Keypad module tshem tawm qhov xav tau rau txhua qhov ntawm cov khoom siv digital no. Raws li nws lub npe cuam tshuam, Ib Tus Pin Keypad siv tsuas yog ib tus pin (cov lus sib piv sib xws) ntxiv rau GND thiab VCC kev sib txuas, yog li txuas koj lub xov tooj cua yog nrawm! Rau Raspberry Pi cov neeg siv (lub hom phiaj cov neeg mloog rau qhov kev qhia no) nws tseem xav tau ADS1115 analog rau digital hloov pauv, uas yog qhov yooj yim heev rau xaim. Ib Tus Pin Keypad Python Pob (suav nrog) kuj tseem yooj yim rau lub program xav tau los ua cov txheej txheem ntawm cov keyboard, txuag koj lub sijhawm thiab siv zog ntau dua.
Rau Arduino Siv Qhia, nyem qhov no.
Kauj Ruam 1: Sau tag nrho Txhua Qhov
Txhawm rau pib nrog koj Ib Tus Pin Keypad board, koj yuav xav tau:
- Ib Tus Pin Keypad Board
- Ib qho Arduino ntawm qee qhov tsw (Ib qho Arduino Nano tau siv hauv qhov no)
- 3 M/F jumper cables,
- 4 M/M LOSSIS 4 ntau M/F jumper cables, nyob ntawm seb hom headers nyob ntawm koj li Raspberry Pi
- Lub 16 khawm membrane membrane keypad
- Breadboard (Ib qho me me tiag yog siv ntawm no)
- ADS1115 Module (los ntawm Adafruit lossis clone)
- Raspberry Pi nrog kev txuas internet thiab Raspbian OS (Kuv siv Ncab)
- Raspberry Pi Accessories (ib qho HDMI Cable, lub zog siv, dongles, saib, thiab lwm yam yog nyob ntawm qhov tsw ntawm koj li Raspberry Pi)
Kauj ruam 2: Txuas
Hlau Ib Tus Pin Keypad raws li daim duab Fritzing, daim duab lossis ob qho tib si, qhov twg koj xav tau.
Thov nco tseg: daim ntawv ntawm Fritzing daim duab sawv cev rau Ib Tus Pin Keypad (thiab cov ntawv luv GND VCC thiab AOUT xaiv tus pinouts ntawm One Pin Keypad board)
Kauj Ruam 3: Nthuav Tawm Pob Python
Qhib lub davhlau ya nyob twg qhov rai thiab ntaus cov lus txib hauv qab no:
sudo apt-tau hloov tshiab
ces
pip3 nruab Progetto-One-Pin-Keypad
txhawm rau txhim kho pob thiab nws cov kev xav tau tsim nyog
Kauj Ruam 4: Txhim Kho Cov Piv Txwv
Kuv tsim cov ntawv tais ceev tseg rau tsev rau qhov chaw cia khoom nyob hauv tsev/pi yog tias koj xav ua tib yam (nws yog qhov ua tau kiag li), khiav cov lus txib no:
mkdv dev
tom qab ntawd, txhawm rau nkag mus rau hauv daim nplaub tshev, ntaus:
cd devv
Thaum kawg, txhawm rau clone lub chaw cia khoom, nkag mus rau cov lus txib hauv qab no:
git clone
Kauj ruam 5: Pab kom I2C
ADS1115 ADC (Analog to Digital Converter) tso siab rau I2C (Inter-Integrated Circuit) raws tu qauv txhawm rau sib tham nrog Raspberry Pi, los ntawm lub neej ntawd I2C npav tsis taus, kom pab tau nws, ntaus:
sudo raspi-teeb tsa
uas yuav coj koj mus rau lub qhov rai teeb tsa xiav, los ntawm qhov ntawd, siv cov xub xub thiab tus yuam sij nkag, xaiv
- Kev xaiv cuam tshuam
- Kuv 2C
- Tom qab ntawd mus rau
Tswv yim: Xa mus rau cov duab saum toj no tuaj yeem pab me ntsis! Yog tias koj tseem nyam, tsis ntshai! Xa mus rau qhov ua tau zoo npaum li cas-los ntawm Sparkfun!
Kauj Ruam 6: Khiav Calibratethresholds
Nkag mus rau qhov chaw cia khoom yog tias koj tsis tau ua thiab mus rau cov piv txwv piv txwv siv cov lus txib no:
Tswv yim: ntaus 'cd Prog' ces ntaus Tab, nws yuav tsum ua kom tiav lub npe khaws cia!
cd Progetto_One_Pin_Keypad_Python_Package
ces ntaus:
cd piv txwv
tom ntej no, khiav qhov piv txwv calibratethresholds siv cov lus txib no:
nab hab sej 3 calibratethresholds
thiab ua raws cov lus qhia pom ntawm lub console txhawm rau ntsuas koj lub rooj tsavxwm. Tom qab ntsuas ntsuas taug kev los ntawm txhua lub nyees khawm, ntsuas tawm koj qhov txiaj ntsig zoo sib xws kom pom tias lawv ua haujlwm los ntawm nias qee lub nyees khawm thaum hais kom "Pib.", Yog tias qhov txiaj ntsig tshiab ua pov thawj tsis raug, siv Ctrl C los tua qhov program thiab khiav nws. dua.
Qhov piv txwv ntsuas yuav tsum muab rau koj 2 kab ntawm txoj cai koj yuav xav tau hauv qhov piv txwv tom ntej, nco ntsoov khaws lub console qhib thiab/lossis luam ob qho tib si!
Kauj ruam 7: Hloov kho thiab Tom qab ntawd Nyem Readkeypadwithtimeout
Tam sim no tias koj Ib Tus Pin Keypad tau ntsuas, nws yog lub sijhawm siv nws los siv. Thaum koj tuaj yeem ua qhov no los ntawm kab hais kom ua siv vi, Kuv tus kheej nyiam siv IDE zoo li IDLE.
Qhib IDLE li (koj yuav xav tau cov nab hab sej version 3) thiab hloov kho kab hauv qab no:
Nco ntsoov tias cov nqi sib piv uas koj tau theej? Hloov kab 13 (saib hauv qab) nrog cov tshiab calibrated analog qhov tseem ceeb.
# ex: my_thresholds = [ntsuas qhov tseem ceeb yuav nyob ntawm no]
yog hloov nrog qhov no:
my_thresholds = [225, 2116, 3904, 5200, 6300, 7350, 8450, 9325, 10000, 10750, 11500, 12100, 12550, 13100, 13800, 14250]
Tom ntej no, ntxiv kab kab ntawv txuas ntxiv mus tom qab kab 23, (saib hauv qab):
keypad.useCalibratedThresholds (my_thresholds)
tau ntxiv tom qab kab 23:
# ex: keypad.use_calibrated_thresholds (koj lub npe array)
ua kab 22 txog 24 zoo li qhov no thaum kawg:
# Yog tias ntsuas qhov ntsuas tau siv, siv_calibrated_thresholds hauv qab no:
# ex: keypad.use_calibrated_thresholds (koj lub npe array)
keypad.use_calibrated_thresholds (kuv_thresholds)
Tom qab ua tiav, khiav cov cai thiab sim nws los ntawm kev nias qee lub pob! Xav tias dawb los hloov qhov piv txwv piv rau koj cov haujlwm! Nco ntsoov tias read_keypad_with_timeout rov qab lub pob raug nias raws li tus lej thiab lub sijhawm tau teev tseg hauv vib nas this! Yog tias koj tsis xav kom ncua sijhawm siv lub keypad. NO_TIMEOUT tas li.
Kauj Ruam 8: Yuav Ua Li Cas Ib Tus Pin Keypad Ua Haujlwm
Ntau ntawm Ib Tus Pin Keypad tus qauv tsim tawm los ntawm Hari Wiguna qhov kev siv ntawm qhov faib hluav taws xob kom tau txais tus nqi sib piv rau txhua tus yuam sij hauv 16 tus lej tus lej. Ib Tus Pin Keypad tus tsim tseem zoo ib yam, nrog ob peb tweaks. Yog tias koj xav tau cov lus qhia zoo txog yuav ua li cas One Pin Keypad ua haujlwm, xav tias dawb los tshuaj xyuas Hari Wiguna qhov yees duab txaus ntawm no!
Kauj Ruam 9: Xaus
Hauv cov lus qhia no, peb tau hais qhia yuav pib li cas nrog koj Ib Tus Pin Keypad board. Tam sim no, qhov xav paub ntawm koj yuav xav tias vim li cas readKeypadInstantaneous piv txwv kos duab tsis tau siv, qhov laj thawj yog tias nws tsis muaj txiaj ntsig, vim tias lub pob yuav tsum tau nias thaum nws raug hu, readKeypadInstantaneous () muaj nuj nqi tau siv feem ntau los ua kom yooj yim. readKeypadWithTimeout () hauv lub tsev qiv ntawv. Yog tias nws ntes koj lub qhov muag xav kom coj nws mus rau qhov tig. Zoo siab Hacking!
Yog tias koj muaj lus nug, tawm tswv yim hauv qab no lossis email rau peb ntawm [email protected]. Txhua qhov zoo tshaj, Progetto Company P. S. Raws li tau cog lus tseg, txuas mus rau pawg thawj coj saib Eagle Files.
Pom zoo:
Pandemi: Tus Nqi Tus Nqi Tus Nqi Tus Kab Mob Qis Tsawg Tus Nqi: 7 Kauj Ruam
Pandemi: Tus Nqi Tus Nqi Tus Nqi Tus Kab Mob Qis Tsawg Tus Nqi: Qhov no yog qhov pheej yig, yooj yim los ua neeg hlau. Nws tuaj yeem ua kom tsis muaj menyuam hauv koj chav nrog UV-C lub teeb, nws yog lub teeb thiab nrawm, nws tuaj yeem mus rau txhua qhov av, thiab nws tuaj yeem haum rau txhua lub qhov rooj. Nws tseem yog tib neeg-nyab xeeb, thiab muaj kev ywj pheej tag nrho
Kev Ruaj Ntseg Hauv Hluav Taws Xob Nrog RTC thiab Tus Neeg Siv Qhia Tus lej Pin: 7 Cov Kauj Ruam
Kev Ruaj Ntseg Hauv Hluav Taws Xob Nrog RTC thiab Tus Neeg Siv Qhia Tus lej PIN: Nyob Zoo Cov Menyuam! Nov yog qhov haujlwm uas kuv tau siv siv pic microcontroller nws tus lej Electronic PIN Code Security System nrog lub sijhawm tiag tiag thiab tus neeg siv txhais tus lej tus lej tus lej, nplooj ntawv no suav nrog txhua yam kom ntxaws rau koj tus kheej
ARUPI - Tus Nqi Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi Uas Tau Txais Tus Nqi/Tus Kheej Tus Kheej (ARU) rau Soundscape Ecologists: 8 Kauj Ruam (nrog Duab)
ARUPI - Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi/Tus Kheej Tus Kheej (ARU) rau Soundscape Ecologists: Cov lus qhia no tau sau los ntawm Anthony Turner. Txoj haujlwm tau tsim los nrog ntau qhov kev pab los ntawm Shed hauv Tsev Kawm Ntawv ntawm Kev Suav, University of Kent (Mr Daniel Knox tau pab zoo!)
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
Yuav Ua Li Cas Ua Tus Qhia Qhia thiab Qhia: 8 Kauj Ruam
Yuav Ua Li Cas Nthuav Qhia Qhia thiab Qhia: Nov yog phau ntawv qhia rau kev ua Qhia Qhia thiab Qhia. Nws yog qhov tseem ceeb tshaj plaws ntawm cov xwm txheej muaj nyob rau Hnub Friday, Peb Hlis 9, 2007, tab sis kuj tseem yog qhov tshwm sim yav dhau los ntawm qhov xwm txheej no, Squid Labs Lub Teeb Pom Kev Zoo. Lub hom phiaj ntawm Kev Qhia thiab Xov Tooj