void APDS_Init()
{
u8 ATIME = 0xff; // 2.7 ms – minimum ALS integration time
u8 WTIME = 0xff; // 2.7 ms – minimum Wait time
u8 PTIME = 0xff; // 2.7 ms – minimum Prox integration time
u8 PPULSE = 0x8e; // Minimum prox pulse count
IIC_write_add(0, 0); //Disable and Powerdown
IIC_write_add(1, ATIME);
IIC_write_add(2, PTIME);
IIC_write_add(3, WTIME);
IIC_write_add(0x0e, PPULSE);
IIC_write_add(0x00, 0x0f);
}
|