description:
Integrated environment and infrared optical digital converter interface with built-in infrared LED and I2C. The device not only provides ambient light sensing but also provides strong backlight/display brightness
Control but infrared sensor to allow access with interrupt function
Operating voltage range is 1.7V to 3.6V
Note: the welding temperature here
NC and LDR are disconnected, and the FAE engineer of the sensor confirms that it can be disconnected here.
Test the hardware circuit-read the 3e register to get the correct result, indicating that the hardware is okay, and the I2C simulation code is okay
Write the initialization register according to the demo example
Then observe if the ic light is flashing, use the mobile phone to take a photo to see
Use a book to completely obscure and view the changes, and use the serial port to print one time in 1S. The value of the 11 and 12 registers is closer to the sensor, the greater the PS value.
FAE: Maybe the update is not too fast. Change the distance to occlude, he updates the data according to the amount of reflected energy
Change the different object or distance during the reading process, then the value will not change at this time. You can read 13 14 The change in value is more obvious
If you change different objects or distances during the reading process, the value will change at this time
Judgment: But we generally use the ps value and the set threshold to judge. Here I set the mode to FLAG mode, and use the int pin to indicate whether it is close. See the figure below for details.
At this point, the sensor drive is ok. The low power consumption state is added later.