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 - BH1715 Digital Ambient Light Sensor Python Qhia: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
BH1715 yog digital Ambient Light Sensor nrog I²C tsheb npav sib cuam tshuam. BH1715 feem ntau yog siv kom tau txais cov ntaub ntawv teeb pom kev zoo los kho LCD thiab Keypad lub teeb pom kev zoo rau lub xov tooj ntawm tes. Cov cuab yeej no muaj 16-ntsis kev daws teeb meem thiab ntsuas ntsuas tau ntau, tso cai kuaj pom los ntawm.23 txog 100, 000 lux. 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. HLB 1715
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 qho kawg ntawm I2C cable rau BH1715 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 BH1715 tuaj yeem rub tawm los ntawm peb GitHub chaw cia khoom- Dcube Store.
Nov yog qhov txuas rau tib yam:
github.com/DcubeTechVentures/BH1715…
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.
# HLB 1715
# Txoj cai no yog tsim los ua haujlwm nrog BH1715_I2CS I2C Mini Module muaj nyob hauv Dcube Store.
ntshuam smbus
lub sij hawm ntshuam
# Tau I2C npav
npav = smbus. SMBus (1)
# BH1715 chaw nyob, 0x23 (35)
# Xa lub zog ntawm kev hais kom ua
# 0x01 (01) Hwj chim On
npav.write_byte (0x23, 0x01)
# BH1715 chaw nyob, 0x23 (35)
# Xa cov lus ntsuas ntsuas mus tas li
# 0x10 (16) Teeb hom kev daws teeb meem tsis tu ncua, 1 lux daws teeb meem, Sijhawm = 120ms
npav.write_byte (0x23, 0x10)
sijhawm.s pw (0.5)
# BH1715 chaw nyob, 0x23 (35)
# Nyeem cov ntaub ntawv rov qab, 2 bytes siv Kev Hu Xov Tooj
# luminance MSB, luminance LSB
cov ntaub ntawv = bus.read_i2c_block_data (0x23, 2)
# Hloov cov ntaub ntawv
luminance = (cov ntaub ntawv [0] * 256 + cov ntaub ntawv [1]) / 1.2
# Cov ntaub ntawv tso tawm rau lub vijtsam
luam "Ambient Light luminance: %.2f lux" %luminance
Kauj Ruam 4: Cov ntawv thov:
BH1715 yog lub teeb pom kev ib puag ncig lub teeb pom kev zoo uas tuaj yeem suav nrog hauv xov tooj ntawm tes, LCD TV, NCEJ PC thiab lwm yam. siv lub teeb pom kev zoo.
Pom zoo:
Arduino Nano - TSL45315 Ambient Light Sensor Qhia: 4 Kauj Ruam
Arduino Nano - TSL45315 Ambient Light Sensor Qhia: TSL45315 yog lub teeb pom kev zoo ib puag ncig digital. Nws kwv yees tib neeg qhov muag teb raws ntau yam teeb pom kev zoo. Cov cuab yeej muaj peb lub sijhawm xaiv ua ke thiab muab ncaj qha 16-ntsis lux tso tawm ntawm I2C tsheb npav sib cuam tshuam. Cov cuab yeej siv
Raspberry Pi - TSL45315 Ambient Light Sensor Java Qhia: 4 Kauj Ruam
Raspberry Pi - TSL45315 Ambient Light Sensor Java Qhia: TSL45315 yog lub teeb pom kev zoo ib puag ncig digital. Nws kwv yees tib neeg qhov muag teb raws ntau yam teeb pom kev zoo. Cov cuab yeej muaj peb lub sijhawm xaiv ua ke thiab muab ncaj qha 16-ntsis lux tso tawm ntawm I2C tsheb npav sib cuam tshuam. Cov cuab yeej siv
Raspberry Pi - TSL45315 Ambient Light Sensor Python Qhia: 4 Kauj Ruam
Raspberry Pi - TSL45315 Ambient Light Sensor Python Qhia: TSL45315 yog lub teeb pom kev zoo ib puag ncig digital. Nws kwv yees tib neeg qhov muag teb raws ntau yam teeb pom kev zoo. Cov cuab yeej muaj peb lub sijhawm xaiv ua ke thiab muab ncaj qha 16-ntsis lux tso tawm ntawm I2C tsheb npav sib cuam tshuam. Cov cuab yeej siv
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