Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Kev sib txuas rau Ethernet rau I2C Sensor Choj
- Kauj Ruam 2: Txuas Ethernet thiab Muab Lub Hwj Huam
- Kauj Ruam 3: Teeb
- Kauj ruam 4:
- Kauj Ruam 5: Sau Nrog Python lossis Lwm Yam Lus
Video: MCP23017 GPIO Tswj Via Ethernet: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Tswj MCP23017 IO-txuas ntxiv ntawm ethernet siv Sensor Choj thiab MCP23017 tawg tawm lub rooj tsavxwm. Cov lus txib xa los ntawm Python cov ntawv, browser URLs lossis ib qho system uas muaj peev xwm ntawm kev sib txuas lus HTTP. Tuaj yeem koom ua ke rau Tsev Pabcuam rau kev siv tshuab hauv tsev.
Cov xov hlau txuas nrog rau Phoenix Connector clamp txuas. Cov xeev GPIO tau qhia los ntawm LEDs. Qhov chaw nyob tuaj yeem xaiv los ntawm 0x20 txog 0x27. GPIO BoB tuaj yeem ntsia tau rau ntawm txoj kab tsheb ciav hlau DIN. Sensor Choj tau teeb tsa flanges.
Khoom siv
Kallio Designs - Sensor Choj Digital (Ethernet rau I2C):
Kallio Designs MCP23017 Break out Board (I2C GPIO BoB):
8 - 26 V, 2 W Fais fab mov
Ethernet cables
Kauj Ruam 1: Kev sib txuas rau Ethernet rau I2C Sensor Choj
Txuas tus pin 3 thiab 4 rau SCL thiab SDA tus pin ntawm MCP23017 txhawm rau tshem tawm lub rooj tsav tsheb rau I2C npav.
Txuas tus pin 5 thiab 6 rau +5 V thiab GND pins ntawm MCP23017 tawg tawm pawg thawj coj saib. Qhov no yuav muab lub zog rau chav nyob.
Kauj Ruam 2: Txuas Ethernet thiab Muab Lub Hwj Huam
Yog tias koj muaj lub zog hla ethernet (PoE) muaj, tsuas yog txuas lub ethernet cable. Koj kuj tuaj yeem siv lub tshuab txhaj tshuaj. Ob chav yuav tsum muaj zog, tus qauv PoE cuam tshuam tuaj yeem txhawb nqa ob chav.
Yog tias koj tsis muaj PoE, txuas lub ethernet cable thiab 8-26 V, 2 W fais fab mov rau tus pin 1 (GND) thiab 2 (Qhov zoo).
Koj yuav tsum pom lub cim ntsuab LED teeb ntxiv rau qhov chaw nres nkoj ethernet LEDs qhia txog kev mus los.
Kauj Ruam 3: Teeb
Xyuas kom tseeb tias koj lub PC lossis lwm yam khoom siv tswj hwm nyob hauv tib lub network LAN zoo li Sensor Choj.
Siv cov nqes hluav taws xob tso rau ntawm lub rooj sib tsoo tawm los teeb tsa I2C chaw nyob (lub neej ntawd hex 0x20, uas txhais ua zauv 32).
Kauj ruam 4:
Cov lus txib tau piav qhia hauv Sensor Bridge tus neeg siv phau ntawv. Qhov kev xaiv yooj yim yog siv qhov ua hauv -cov lus txib, kom tsis txhob muaj teeb tsa ntau lub npe rau lub luag haujlwm.
Tshawb nrhiav "192.168.1.195/MCP27OA41" yuav teeb tus pin A4 kom siab. Koj yuav pom LED A4 teeb ntawm sab xis sab xis LED cov tsev txhab nyiaj. Koj mus rau "192.168.1.195/MCP27IA4" yuav nyeem tib tus pin thiab tso saib nws lub xeev ntawm qhov browser. LED tseem yuav tau taws yog tias tus pin tau teeb tsa sab nraud.
Kauj Ruam 5: Sau Nrog Python lossis Lwm Yam Lus
Txhawm rau tsim cov laj thawj ntxiv rau txoj haujlwm koj tuaj yeem siv Python urllib xa cov lus txib. Txhawm rau nyeem tus pin A4 xeev:
ntshuam urllib.requestprint (urllib.request.urlopen ("https://192.168.1.190/MCP27IA4").read ()) input ("Nias nkag mus kom tawm")
Lossis koj tuaj yeem siv curl los siv I2C interface ncaj qha. Txhawm rau teeb tsa txhua tus pin hauv chaw nres nkoj A raws li cov zis:
curl 192.168.1.195/I2CSTA027curl 192.168.1.195/I2CW00curl 192.168.1.195/I2CW00curl 192.168.1.195/I2CSENDS
Tib cov lus txib tuaj yeem xa los ntawm ib qho cuam tshuam nrog cov txiaj ntsig zoo ib yam, uas puas haum rau koj txoj haujlwm zoo tshaj plaws.
Pom zoo:
Raspberry PI 3 - Pab Kev Sib Txuas Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15: 9 Cov Kauj Ruam
Raspberry PI 3 - Pab Txhawb Kev Sib Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15: Kuv nyuam qhuav muaj kev txaus siab los ua kom UART0 ntawm kuv Raspberry Pi (3b) yog li kuv tuaj yeem txuas nws ncaj qha rau RS -232 teeb liab qib ntaus ntawv siv tus qauv 9 -pin d-sub txuas tsis tas yuav hla USB mus rau RS-232 adapter. Ib feem ntawm kuv qhov kev xav
Ntoo RC Nkoj Uas Koj Tuaj yeem Tswj Tus Kheej lossis Via Lub Vev Xaib: 9 Kauj Ruam
Ntoo RC Nkoj Uas Koj Tuaj yeem Tswj Tus Kheej lossis Via Lub Vev Xaib: Nyob zoo Kuv yog menyuam kawm ntawv ntawm Howest thiab kuv tau tsim Ntoo Ntoo nkoj uas koj tuaj yeem tswj tau ntawm tus tswj lossis ntawm lub vev xaib. thiab kuv xav tau qee yam kom txaus siab rau kuv tus kheej thaum kuv nyob ntawm hiav txwv
Tswj Ntau LEDs Nrog Python thiab Koj Raspberry Pi's GPIO Pins: 4 Cov Kauj Ruam (nrog Duab)
Tswj Ntau LEDs Nrog Python thiab Koj Raspberry Pi's GPIO Pins: Cov lus qhia no qhia txog yuav ua li cas thiaj tswj tau ntau tus GPIO pins ntawm koj li RaspberryPi kom muaj zog 4 LEDs. Nws tseem yuav qhia koj txog cov ntsiab lus thiab cov nqe lus hais hauv Python.Our yav dhau los Cov Lus Qhia Siv Koj Raspberry Pi's GPIO Pins rau Con
Tsheb Tswj Chaw Taws Teeb - Tswj Kev Siv Wireless Xbox 360 Tus Tswj: 5 Kauj Ruam
Lub Tsheb Tswj Chaw Taws Teeb - Tswj Kev Siv Wireless Xbox 360 Tus Tswj: Cov no yog cov lus qhia txhawm rau tsim koj tus kheej lub tsheb tswj chaw taws teeb, tswj siv wireless Xbox 360 maub los
ESP8266 RGB LED Sawb WIFI Tswj - NODEMCU Raws li IR Chaw Taws Teeb rau Led Sawb Tswj Hauv Wifi - RGB LED Sawb Smartphone Tswj: 4 Cov Kauj Ruam
ESP8266 RGB LED Sawb WIFI Tswj | NODEMCU Raws li IR Chaw Taws Teeb rau Led Sawb Tswj Hauv Wifi | RGB LED Sawb Smartphone Tswj: Nyob zoo cov neeg hauv qhov kev qhia no peb yuav kawm paub siv nodemcu lossis esp8266 li IR chaw taws teeb los tswj RGB LED sawb thiab Nodemcu yuav raug tswj los ntawm smartphone dhau wifi. Yog li hauv paus koj tuaj yeem tswj RGB LED Sawb nrog koj lub xov tooj