Library for M5Stack light-related units using M5UnitUnified. M5UnitUnified is a library for unified handling of various M5 units products.
Unit DLight is a digital ambient light detection sensor that uses the BH1750FVI illuminance sensor IC (I2C interface). It has a built-in 16-bit AD converter supporting illuminance value detection ranging from 1 to 65535 lx. It is characterized by its small size and low power consumption, making it suitable for various illuminance detection and light control adjustment scenarios.
Hat DLight is a digital ambient light detection sensor compatible with the M5StickC/C Plus series. The hardware uses the BH1750FVI illuminance sensor IC (I2C interface), with a built-in 16-bit AD converter, supporting illuminance value detection from 1 to 65535 lx. It features a small size and low power consumption, making it suitable for various illuminance detection and light control adjustment scenarios.
Unit Light is a light intensity detection sensor. It integrates a photoresistor and a 10K adjustable resistor, capable of detecting light intensity and setting a light intensity threshold. The resistance of the photoresistor decreases as the incident light intensity increases, thus detecting the change in voltage, and obtaining light intensity data through AD conversion. To achieve more accurate light intensity measurements, this Unit also adopts the LM393 dual differential comparator, used to compare the differential voltage between the photoresistor and the varistor.
See also examples using conventional methods here.
Support via PbHub
| Unit | Support | Note |
|---|---|---|
| UnitLight | OK |
See also M5Unit-HUB
See also examples/UnitUnified
You must choose a define symbol for the unit you will use. (Uncomment the corresponding #define in the example, or specify it with compile options.)
- UnitDLight / HatDLight (PlotToSerial)
// *************************************************************
// Choose one define symbol to match the unit you are using
// *************************************************************
#if !defined(USING_UNIT_DLIGHT) && !defined(USING_HAT_DLIGHT)
// For UnitDLight (U136)
// #define USING_UNIT_DLIGHT
// For HatDLight (U134)
// #define USING_HAT_DLIGHT
#endifIf you want to generate documents on your local machine, execute the following command
bash docs/doxy.sh
It will output it under docs/html
If you want to output Git commit hashes to html, do it for the git cloned folder.