in libs/bead-drivers/TSL2591.ts [148:171]
export function configureSensor(atime: TSL2591_ATIME,gain: TSL2591_AGAIN)
{
//Always make sure the sensor is connected. Useful for cases when this block is used but the sensor wasn't set randomly.
while (!isConnected)
{
initSensor();
}
atimeIntegrationValue = atime;
gainSensorValue = gain;
//Turn sensor on
enableSensor();
//REGISTER FORMAT: CMD | TRANSACTION | ADDRESS
//REGISTER VALUE: TSL2591_REGISTER_COMMAND (0x80) | TSL2591_REGISTER_CONTROL (0x01)
//REGISTER WRITE: atimeIntegrationValue | gainSensorValue
RegisterHelper.writeRegister(TSL2591_I2C_ADDR,TSL2591_REGISTER_COMMAND | TSL2591_REGISTER_CONTROL, atimeIntegrationValue | gainSensorValue);
//Turn sensor off
disableSensor();
}