Cov txheej txheem:
- Kauj Ruam 1: Qee Cov Plhaub Comands
- Kauj Ruam 2: Case One: I2c Devices Muaj Tib Qhov Chaw Nyob
- Kauj Ruam 3: Rooj Plaub 2: Qhov Chaw I2c Txawv
Video: Raspberry PI Ntau I2C Devices: 3 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Tsis txaus siab vim tias koj tsis tuaj yeem siv ntau ntawm tib I2C cov cuab yeej hauv koj txoj haujlwm. Tsis tas yuav siv qeeb multiplexers. Qhov tseeb raspbian kernel txhawb kev tsim ntau I2C busses siv GPIO pins. Cov tshuaj no yog nrawm heev.
Kauj Ruam 1: Qee Cov Plhaub Comands
Txuas ib qho ntawm koj lub cuab yeej i2c thaum koj raspberry pi yog ntawm, pib koj raspberry pi thiab khiav
sudo i2cdetect -y 1
Koj yuav pom lub rooj zoo li hauv daim duab txuas. Kuv tau xa BMP280 qhov kub thiab txias siab ntsuas. Qhov chaw nyob i2c yog 0x76 raws li cov lus. Nco qhov chaw nyob no.
Ua qhov no rau tag nrho koj cov cuab yeej i2c.
Kauj Ruam 2: Case One: I2c Devices Muaj Tib Qhov Chaw Nyob
Qhov no ib txwm muaj teeb meem teeb meem. Lub tsheb npav i2c tuaj yeem siv ntau yam khoom siv, tab sis lawv yuav tsum muaj qhov chaw nyob sib txawv i2c. Qee cov khoom siv i2c muaj cov dhia dhia los teeb tsa lwm qhov chaw nyob i2c, tab sis ntau tus tsis ua. Hauv qhov no koj tuaj yeem siv i2c multiplexer (kho vajtse) tig lub i2c SDA (Cov Ntaub Ntawv) thiab SCL (Clock) lossis koj tuaj yeem tsim lub npav i2c ntxiv lossis ntau dua.
Kuv yuav tsim ob lub npav ntxiv, nl npav 3 thiab 4
Qhib cli thiab khiav
cd /pib
sudo nano teeb tsa.txt
Ntxiv cov kab hauv qab no, nyiam dua hauv ntu uas spi thiab i2c tau qhib.
dtoverlay = i2c-gpio, npav = 4, i2c_gpio_delay_us = 1, i2c_gpio_sda = 23, i2c_gpio_scl = 24
Kab ntawv no yuav tsim ib lub npav i2c ntxiv (tsheb npav 4) ntawm GPIO 23 raws li SDA thiab GPIO 24 raws li SCL (GPIO 23 thiab 24 yog qhov ua tsis tau)
Kuj ntxiv cov kab hauv qab no los tsim i2c npav 3
dtoverlay = i2c-gpio, npav = 3, i2c_gpio_delay_us = 1, i2c_gpio_sda = 17, i2c_gpio_scl = 27
GPIO 17 yuav yog SDA thiab GPIO 27 yuav yog SCL rau i2c npav 4.
Tipe tswj X kom tawm mus.
Nco tseg ntawm Tus Npav Npav Npav thiab xaj:
Tsis txhob siv tsheb npav 0 thiab 2, nws yog siv rau lwm yam hauv pawg thawj coj zoo li eprom ntawm lub kaus mom thiab lwm yam
Rau lub Plaub Hlis 2019 raspbian tso tawm:
Koj yuav tsum ib txwm pib nrog lub npav loj tshaj (Tsheb 4 hauv qhov no) hauv koj qhov kev teeb tsa.txt thiab ua haujlwm dhau mus rau lub npav qis tshaj (tsheb npav 3).
Lub tsheb npav qis tshaj yuav tsum yog npav 3
Yog tias koj xav tau 5 lub tsheb npav ntxiv, cov tsheb npav yuav tsum yog ob qho ntawm 7, 6, 5, 4, 3
Qhov teeb meem ntawm kev xaj tsheb npav tsis nyob ntawd thaum Phau Ntawv Qhia no tau xub sau tseg. Nws zoo li kev hloov pauv tau ua rau lub ntsiav.
Kaw koj tus PI, hloov nws ntawm. Txuas koj lub cuab yeej i2c mus rau npav 4 (SDA rau GPIO 23 thiab SCL rau GPIO 24) thiab lwm qhov rau i2c npav 3 (SDA rau GPIO 17 thiab SCL rau GPIO 27).
Hloov rau pi.
Khiav:
sudo i2cdetect -l (Cov Ntaub Ntawv L)
Tam sim no koj yuav pom tias i2c npav 3 thiab 4 kuj tau teev tseg. Kuj khiav:
sudo i2cdetect -y 3
sudo i2cdetect -y 4
Tam sim no koj tuaj yeem siv koj lub sensor hauv koj cov lus programming. Nco ntsoov qhia qhov tseeb i2c busses.
Txuas yog qhov piv txwv rau qhov nrov BMP280 Kub thiab Siab sensor. Tsis muaj multiplexer tuaj yeem nyeem 2 BMP280s qhov nrawm no.
Ib qho piv txwv ntawm 2 Sensirion SDP 810 sensors kuj tseem txuas nrog. Ib zaug ntxiv ua haujlwm tau nrawm dua li lub tshuab multiplexer kuv tau siv yav dhau los
Kuv tsim cov nab npawb nab npawb los nyeem ob qhov tshiab BMP388s los ntawm adafruit.
Kuv kuj tseem tuaj yeem ntxiv lwm qhov ntsuas pom yav tom ntej rau
Kauj Ruam 3: Rooj Plaub 2: Qhov Chaw I2c Txawv
Yooj yim. i2c yog bus. Lub tsheb npav purpouse yog sib tham nrog ntau yam khoom siv. Txuas cov cuab yeej txuas mus rau tib lub tsheb npav i2c. Koj tuaj yeem siv npav npav.
Khiav:
sudo i2cdetect -y 1
Koj yuav pom cov cuab yeej teev tseg.
Pom zoo:
Arduino Txuas Ntau I2C Devices: 6 Cov Kauj Ruam
Arduino Txuas Ntau I2C Devices: Hauv qhov kev qhia no peb yuav kawm paub txuas ob peb tus qauv nrog I2C txuas mus rau arduino.Watch Cov Yees Duab! Hauv peb qhov xwm txheej peb yuav siv 4 OLED Cov Lus Qhia ua piv txwv, tab sis koj tuaj yeem siv lwm yam I2C modules/ Nco tseg: 4 OLED Displays co
Ntau yam I/O Extender PCB los Tswj Ntau Nixie Tubes nrog I2C: 9 Cov Kauj Ruam (nrog Duab)
Ntau yam I/O Extender PCB los Tswj Ntau Nixie Tubes Nrog I2C: Tam sim no muaj kev txaus siab heev los nqa cov raj nixie qub rau lub neej. Ntau tus nixie raj cov khoom siv hauv lub moos muaj nyob ntawm khw. Muaj tshwm sim txawm tias muaj kev lag luam nyob ntawm cov khoom qub ntawm Lavxias nixie hlab. Kuj ntawm no ntawm Cov Ntawv Qhia muaj
Ib qho yooj yim IOT - App Tswj RF Sensor Hub rau Nruab Nrab Ntau Yam IOT Devices: 4 Cov Kauj Ruam
YOT yooj yim IOT - App Tswj RF Sensor Hub rau Nruab Nrab Ntau Yam IOT Devices: Hauv kab lus qhia no, peb yuav tsim lub network ntawm cov cuab yeej uas tuaj yeem tswj tau los ntawm kev txuas xov tooj cua los ntawm lub hauv paus hub. Cov txiaj ntsig ntawm kev siv 433MHz xov tooj cua txuas txuas tsis siv WIFI lossis Bluetooth yog qhov ntau dua (nrog qhov zoo
Siv Ntau Tshaj 4 Lub Tshuab Hluav Taws Xob - Tsau Ntau Lub Tsav Tsheb: 3 Kauj Ruam
Siv Ntau Tshaj 4 Lub Tshuab Hluav Taws Xob - Txhim Kho Ntau Lub Cev Muaj Zog: Qhia Vibrotactile Rhuav Lub Cev Hloov Chaw thiab Cov Khoom Siv Ntxiv (https: //www.instructables.com/id/Vibrotactile-Sens …) qhia txog txoj hauv kev tsim lub cuab yeej uas txhais lub siab nkag mus rau hauv vibratory stimuli. Cov vibrations stimuli yog p
Ua Game hauv Notepad thiab Ntau Ntau Ntxiv: 10 Kauj Ruam
Ua Kev Ua Si hauv Notepad thiab Ntau Ntau Ntxiv: Qhov no yog thawj qhov kuv qhia. Yog li yog tias koj muaj lus pom thov tawm tswv yim. Cia peb pib! Thaum peb txhua tus hnov lo lus notepad peb xav txog qee qhov kev siv tsis zoo uas tsis muaj txiaj ntsig los sau cia cov khoom.Lub notepad ntau dua li qhov peb tuaj yeem tswj hwm peb cov