Ardunio开发实例-BH1745NUC亮度和颜色传感器
时间:2023-05-06 05:37:00
BH1745NUC亮度和颜色传感器
BH1745NUC是具有I2C总线接口的数字颜色传感器IC。该IC感应红、绿、蓝光(RGB)并将其转换为数字值。高灵敏度、宽动态范围和卓越性Ircut特性使该IC最适合调节电视、手机和平板电脑的环境光照度和色温LCD背光。可检测非常广泛的光强度。.005 – 40k lx)
1、硬件准备
- 几条杜邦线,一条数据线
- Arduino UNO R3开发板一块
- BH1745NUC一个传感器模块
接线如下
Arduino | 传感器 |
---|---|
3.3v | VIN |
Gnd | Gnd |
SDA/A4 | SDA |
SCL/A5 | SCL |
2、软件准备
- Arduino IDE
3、代码实现
#include // I2C address of the BH1745NUC#define Addr 0x38 void setup()()()()()(///)()()()()()(()()()()()())()()(////)())()()()())()()()///////)()()()())())()())()())())()()()()()()()())()()()()()()())()()()())()()()()()()())()()())()()()())()()()()()()()()()()()()//////)/)/)/)()()()()()()()()()()())()())())())()())()())()())()())()())()()())()())()()()()()())()))()))()))()())())())())()()()())()))()))())())()))()()))()()()))()()()))())())()))())()()())())()))())))))())))()()))())))())))()))()())()())()))()))()()()()()))())))))())())()()()()()))))()))())))))()))))()))())()()))))())()()()()()()()())()))()////////)))))))))))))()))))))))()))))))()()()()()()()())))In