BH1749: Ambient Light Sensor IC
This sample application sets up the BH1749 color sensor to provide 8-bit measurement data every time a set threshold value (>50) is reached for the RED color channel. It also shows how to enable interrupt every time data is ready, instead of threshold trigging.
Requirements
The sample supports the following device:
Hardware platforms |
PCA |
Board name |
Board target |
---|---|---|---|
PCA20035 |
thingy91 |
|
Building and running
This project outputs sensor data to the console. It requires a BH1749 sensor. It should work with any platform featuring a I2C peripheral interface. It does not work on QEMU. The example below uses the Thingy:91.
This sample can be found under samples/sensor/bh1749
in the nRF Connect SDK folder structure.
To build the sample, follow the instructions in Configuring and building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.
Note
When building repository applications in the SDK repositories, building with sysbuild is enabled by default.
If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild
parameter to every build command or configure west to always use it.
Sample output
The following output is displayed in the terminal:
J-Link RTT Viewer
device is 0x20022384, name is BH1749
Threshold trigger
BH1749 RED: 387
BH1749 GREEN: 753
BH1749 BLUE: 397
BH1749 IR: 81
(continues when trigger level reached)