Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Xav Tau..
- Kauj Ruam 2: Kev Sib Txuas:
- Kauj ruam 3: Code:
- Kauj Ruam 4: Cov ntawv thov:
Video: Raspberry Pi - TMD26721 Infrared Digital Proximity Detector Python Qhia: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
TMD26721 yog lub ntsuas hluav taws xob digital sib ze uas muab qhov ua kom pom qhov sib thooj sib xws thiab cov txheej txheem digital sib cuam tshuam hauv ib tus lej 8-pin nto mount module. Qhov kev tshawb pom qhov sib xws suav nrog txhim kho teeb liab-rau-nrov thiab raug. Ib qho kev sib thooj sau npe tso cai them nyiaj rau qhov khoos phis tawj sib txuas nruab nrab ntawm IR LED thiab lub sensor. Nov yog nws qhov ua piv txwv nrog raspberry pi siv tus lej nab npawb.
Kauj Ruam 1: Yam Koj Xav Tau..
1. Raspberry Pi
2. TMD26721
3. I²C Cable
4. I²C Shield rau Raspberry Pi
5. Ethernet Cable
Kauj Ruam 2: Kev Sib Txuas:
Siv daim I2C daim thaiv rau raspberry pi thiab maj mam thawb nws hla gpio pins ntawm raspberry pi.
Tom qab ntawd txuas ib kawg ntawm I2C cable rau TMD26721 sensor thiab lwm qhov kawg rau I2C daim ntaub thaiv.
Kuj txuas Ethernet cable rau pi lossis koj tuaj yeem siv WiFi module.
Kev sib txuas tau qhia hauv daim duab saum toj no.
Kauj ruam 3: Code:
Tus nab npawb nab npawb rau TMD26721 tuaj yeem rub tawm los ntawm peb qhov chaw cia khoom github- Tswj Txhua Yam Hauv Lub Zos
Nov yog qhov txuas rau tib yam:
github.com/ControlEverythingCommunity/TMD2…
Cov ntawv ntawm TMD26721 tuaj yeem pom ntawm no:
s3.amazonaws.com/controleverything.media/c…
Peb tau siv SMBus lub tsev qiv ntawv rau sej code, cov kauj ruam rau nruab SMBus ntawm raspberry pi tau piav qhia ntawm no:
pypi.python.org/pypi/smbus-cffi/0.5.1
Koj tseem tuaj yeem luam cov cai los ntawm no, nws tau muab raws li hauv qab no:
# Faib nrog daim ntawv tso cai yuav dawb.
# Siv nws txhua txoj hauv kev uas koj xav tau, muaj txiaj ntsig lossis pub dawb, muab nws haum rau hauv daim ntawv tso cai ntawm nws cov haujlwm sib txuam.
# TSW 26721
# Txoj cai no yog tsim los ua haujlwm nrog TMD26721_I2CS I2C Mini Module muaj los ntawm ControlEverything.com.
#
ntshuam smbus
lub sij hawm ntshuam
# Tau I2C npav
npav = smbus. SMBus (1)
# TMD26721 chaw nyob, 0x39 (57)
# Xaiv kom tso npe rau npe, 0x00 (0), nrog hais kom sau npe 0x80 (128)
# 0x0D (14) Fais fab, Tos kom qhib, Sib thooj ua haujlwm
bus.write_byte_data (0x39, 0x00 | 0x80, 0x0D)
# TMD26721 chaw nyob, 0x39 (57)
# Xaiv lub sijhawm nyob ze tswj npe, 0x02 (2), nrog hais kom sau npe 0x80 (128)
# 0xFF (255) Sijhawm = 2.73 ms
bus.write_byte_data (0x39, 0x02 | 0x80, 0xFF)
# TMD26721 chaw nyob, 0x39 (57)
# Xaiv tos lub sijhawm tos 0x03 (03), nrog hais kom sau npe, 0x80 (128)# 0xFF (255) Sijhawm - 2.73ms
bus.write_byte_data (0x39, 0x03 | 0x80, 0xFF)
# TMD26721 chaw nyob, 0x39 (57# Xaiv mem tes suav sau npe, 0x0E (14), nrog hais kom sau npe 0x80 (128)
# 0x20 (32) Pulse suav = 32
bus.write_byte_data (0x39, 0x0E | 0x80, 0x20)
# TMD26721 chaw nyob, 0x39 (57)
# Xaiv tswj kev sau npe, 0x0F (15), nrog hais kom sau npe 0x80 (128)
# 0x20 (32) Kev sib thooj siv CH1 diode
bus.write_byte_data (0x39, 0x0F | 0x80, 0x20)
sijhawm.s pw (0.8)
# TMD26721 chaw nyob, 0x39 (57)
# Nyeem cov ntaub ntawv rov qab los ntawm 0x18 (57) nrog hais kom sau npe 0x80 (128), 2 bytes
# Sib thooj lsb, Sib thooj msb
cov ntaub ntawv = bus.read_i2c_block_data (0x39, 0x18 | 0x80, 2)
# Hloov cov ntaub ntawv
sib thooj = cov ntaub ntawv [1] * 256 + cov ntaub ntawv [0]
# Cov ntaub ntawv tso tawm rau lub vijtsam
luam "Qhov sib thooj ntawm lub cuab yeej: %d" %sib thooj
Kauj Ruam 4: Cov ntawv thov:
TMD26721 yog lub infrared digital sib thooj sensor uas tuaj yeem suav nrog hauv Txawb Xov Tooj Ntawm Tes Touchscreen Control thiab Tsis Siv Neeg Lub Xov Tooj Pab Tau. Nws kuj tseem tuaj yeem muab Cov Neeg Siv Khoom Hloov Hloov pauv ntxiv rau Kev Ruaj Ntseg Ntawv. Nws qhov kev ua haujlwm siab thiab ntseeg tau ua rau nws haum rau ntau yam kev nyob ze kev thov.
Pom zoo:
Raspberry Pi MMA8452Q 3-Axis 12-ntsis/8-ntsis Digital Accelerometer Python Qhia: 4 Kauj Ruam
Raspberry Pi MMA8452Q 3-Axis 12-ntsis/8-ntsis Digital Accelerometer Python Tutorial: MMA8452Q yog tus ntse, tsis muaj zog, peb-axis, muaj peev xwm, micromachined accelerometer nrog 12 qhov kev daws teeb meem. Cov neeg siv yooj yim programmable xaiv tau muab nrog kev pab ntawm kev ua haujlwm hauv lub ntsuas qhov ntsuas, teeb tsa tau rau ob qho kev cuam tshuam
Raspberry Pi - TMP007 Infrared Thermopile Sensor Python Qhia: 4 Kauj Ruam
Raspberry Pi - TMP007 Infrared Thermopile Sensor Python Qhia: TMP007 yog lub ntsuas hluav taws xob infrared thermopile uas ntsuas qhov ntsuas kub ntawm ib yam khoom yam tsis muaj kev sib cuag nrog nws. Lub zog hluav taws xob hluav taws xob tso tawm los ntawm cov khoom hauv thaj chaw sensor tau nqus los ntawm cov thermopile ua ke hauv lub ntsuas. Cov thermopil
Raspberry Pi - TMP007 Infrared Thermopile Sensor Java Qhia: 4 Kauj Ruam
Raspberry Pi - TMP007 Infrared Thermopile Sensor Java Qhia: TMP007 yog lub ntsuas hluav taws xob infrared thermopile uas ntsuas qhov ntsuas kub ntawm ib yam khoom yam tsis muaj kev sib cuag nrog nws. Lub zog hluav taws xob hluav taws xob tso tawm los ntawm cov khoom hauv thaj chaw sensor tau nqus los ntawm cov thermopile ua ke hauv lub ntsuas. Cov thermopil
Kuv Me Me Whoop: Daim Ntawv Qhia Whoop + Cov Lus Qhia thiab Cov Lus Qhia: 8 Kauj Ruam
Kuv Me Me Whoop: Daim Ntawv Qhia Whoop + Cov Lus Qhia thiab Cov Lus Qhia: Kev Ceeb Toom: Tam sim no koj tab tom nkag mus rau kuv thawj qhov kev qhia, thiab koj yuav ntsib ntau yam kev ruam thiab tsis muaj phiaj xwm thiab/lossis txuj ci. Paub txog qhov no yog kuv tus kheej Tiny Whoop teeb tsa uas kuv siv txhua hnub, yog li kuv xav tias kuv yuav qhia nws. Nws yog phooj ywg mus ncig (tsis muaj
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