English
Language : 

APDS-9801 Datasheet, PDF (12/24 Pages) AVAGO TECHNOLOGIES LIMITED – Digital Proximity and Analog Ambient Light Sensor
PS – APPLICATION SOFTWARE
Configuration the registers
The Pulse_Freq register and Interval Delay and Control register are initialized to default values when power up. Setting
these registers to desired values would be part of setup procedure. The value can be change to optimize the perfor-
mance need. Below are samples code illustrates the setting of registers for various option.
Set up Pulse_Freq
//20 pulses, 25% Duty Cycle and 100kHz Pulse Frequency
DeviceAddr = 0x55
//Slave address also be –or 0x55
Command = 0x81
//Set Command bit and address of Pulse_Freq
Value = 0x86
WriteByte_i2c(DeviceAddr, Command, Value)
//24 pulses, 50% Duty Cycle and 100kHz Pulse Frequency
DeviceAddr = 0x55
Command = 0x81
Value = 0x8E
WriteByte_i2c(DeviceAddr, Command, Value)
Set up Interval Delay and LED Current Control
//100mA of LED current and 5ms interval delay between the burst pulses
DeviceAddr = 0x55
//Slave address also be – 0x55
Command = 0x82
//Set Command bit and address of register
Value = 0x08
WriteByte_i2c(DeviceAddr, Command, Value)
//150mA of LED current and 250ms interval delay between the burst pulses
DeviceAddr = 0x55
Command = 0x82
Value = 0x1C
WriteByte_i2c(DeviceAddr, Command, Value)
Enable Measurement
DeviceAddr = 0x55
Command = 0x82
ReadByte_i2c(DeviceAddr, Command, & Value)
Value |= 0x20
WriteByte_i2c(DeviceAddr, Command, Value)
//Read back register value
//Set Enable Measurement bit
12