English
Language : 

LTR-507ALS-WA Datasheet, PDF (33/40 Pages) Lite-On Technology Corporation – Optical Sensor
OPTICAL SENSOR
LTR-507ALS-WA
PS Threshold Registers
// The PS_THRES_UP and PS_THRES_LOW registers determines the upper and lower limit of the interrupt threshold
// value.
// Following example illustrates the setting of the PS threshold window of decimal values of 200 (lower threshold) and
// 1000 (upper threshold).
Slave_Addr = 0x23
// Slave address of LTR-559 device
// Upper Threshold Setting (decimal 1000)
PS_THRES_UP_0 = 0x99
PS_THRES_UP_1= 0x9A
Data1 = 1000 >> 8
Data0 = 1000 & 0xFF
WriteByte(Slave_Addr, PS_Upp_Threshold_Reg_0, Data0)
WriteByte(Slave_Addr, PS_Upp_Threshold_Reg_1, Data1)
// PS Upper Threshold Low Byte Register address
// PS Upper Threshold High Byte Register address
// To convert decimal 1000 into two eight bytes register values
// Lower Threshold Setting (decimal 200)
PS_THRES_LOW_0 = 0x9B
PS_THRES_LOW_1 = 0x9C
Data1 = 200 >> 8
Data0 = 200 & 0xFF
WriteByte(Slave_Addr, PS_Low_Threshold_Reg_0, Data0)
WriteByte(Slave_Addr, PS_Low_Threshold_Reg_1, Data1)
// PS Lower Threshold Low Byte Register address
// PS Lower Threshold High Byte Register address
// To convert decimal 200 into two eight bytes register values
ALS Threshold Registers
// The ALS_THRES_UP and ALS_THRES_LOW registers determines the upper and lower limit of the interrupt threshold
// value.
// Following example illustrates the setting of the ALS threshold window of decimal values of 200 (lower threshold) and
// 1000 (upper threshold).
Slave_Addr = 0x23
// Slave address of LTR-507 device
// Upper Threshold Setting (decimal 1000)
ALS_THRES_UP_0 = 0x9E
ALS_THRES_UP_1 = 0x9F
Data1 = 1000 >> 8
Data0 = 1000 & 0xFF
WriteByte(Slave_Addr, ALS_THRES_UP_0, Data0)
WriteByte(Slave_Addr, ALS_THRES_UP_1, Data1)
// ALS Upper Threshold Low Byte Register address
// ALS Upper Threshold High Byte Register address
//To convert decimal 1000 into two eight bytes register values
// Lower Threshold Setting (decimal 200)
ALS_THRES_LOW_0 = 0xA0
ALS_THRES_LOW_1 = 0xA1
Data1 = 200 >> 8
Data0 = 200 & 0xFF
WriteByte(Slave_Addr, ALS_THRES_LOW_0, Data0)
WriteByte(Slave_Addr, ALS_THRES_LOW_1, Data1)
// ALS Lower Threshold Low Byte Register address
// ALS Lower Threshold High Byte Register address
//To convert decimal 200 into two eight bytes register values
Interrupt Persist Register
// The INTERRUPT PERSIST register controls the N number of times the measurement data is out of the threshold range
// for both ALS and PS before asserting the INT output pin 2.
// The default setting is 0x00 (Every PS and/or ALS measurement data will generate an interrupt).
Slave_Addr = 0x23
// Set PS Persist 5 (with ALS persist 0)
Register_Addr = 0xA4
Command = 0x50
// Slave address of LTR-507 device
// INTERRUPT PERSIST register
// PS persist = 5
32/39
Part No. : LTR-507ALS-WA
BNS-OD-FC002/A4