BH1750 | Arduino library for the digital light sensor breakout
kandi X-RAY | BH1750 Summary
kandi X-RAY | BH1750 Summary
The BH1750 has six different measurement modes which are divided in two groups; continuous and one-time measurements. In continuous mode the sensor continuously measures lightness value. In one-time mode, the sensor makes only one measurement and then goes into Power Down mode.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of BH1750
BH1750 Key Features
BH1750 Examples and Code Snippets
Community Discussions
Trending Discussions on BH1750
QUESTION
I am trying to read out an i2c ambient light sensor BH1750 from C in userspace. I am using a BeagleBone pocket with Linux.
The Datasheet says, that after a measurement operation the result needs to be read with the following i2c sequence: S Adr Rd (A) (Data) A (Data) NA P
.
The issue I ran into: All examples/commands I have found either are only reading 1 byte or are requiring a register address to read more.
The closest I found was the following command: i2c_master_recv()
.
However my interpretation of the documentation is that this command is used in kernel-device-drivers.
How can I issue such a I2C-Read-Sequence from Userspace?
...ANSWER
Answered 2021-Oct-17 at 11:01I was able to solve it using this comment from Ian Abbott:
Assuming the I2C controller has been opened, and the I2C_SLAVE ioctl command has been used to set Adr, The read syscall with a length of 2 will perform the above I2C read transaction. – Ian Abbott Oct 4 at 13:45
Here is a Logicanalyzer-Trace of the resulting I2C communication:
QUESTION
I am Linux user and I have those devices:
USB-I2C convertor:
https://www.robot-electronics.co.uk/htm/usb_i2c_tech.htm
GY-30 I2C module:
https://5.imimg.com/data5/TY/AK/MY-1833510/gy-30-bh1750-intensity-digital-light-sensor-module.pdf
And GY-30 is with BH1750 Ambient light sensor:
https://www.mylms.cz/wp-content/uploads/2017/07/bh1750-datasheet.pdf
I need to read Luxs from BH1750 over virtual serial port in Python3, but I am not sure how to do it. I ended with something like this:
...ANSWER
Answered 2020-Apr-05 at 12:11There is final solution:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install BH1750
(For Arduino >= 1.5.x) Install this package by searching for it in the Arduino Library Manager and then clicking install. Alternatively, this library can be installed manually by clicking "Clone or download" -> "Download ZIP" button. Then open Arduino IDE, click Sketch -> Include library -> Add .ZIP library and select the downloaded archive.
(For Arduino < 1.5.x) Download this package as an archive by clicking "Clone or download" -> "Download ZIP" button. Then extract the archive to <Your User Directory>/My Documents/Arduino/libraries/ folder and rename it to BH1750. Restart IDE.
The code in this project can be built locally using the arduino-cli tool. The tool can be installed using the instructions here. Once you have the tool installed you can compile the examples scripts using the convenience script (ci/compile-examples.bash). This script performs the same actions as the project's continuous integration compile checks.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page