A light to digital converter, that has some bells and whistles.
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import { TSL2591, DEFAULT_ADDRESS } from '@johntalton/tsl2591'
const bus = /* byob */
const aBus = new I2CAddressedBus(bus, DEFAULT_ADDRESS)
const device = TSL2591.from(aBus)
await device.setProfile({ enable: true, powerOn: true })
const { ch0, ch1 } = await device.getColor()
Each channel represents the two analog sensors, full spectrum on ch0
and inferred on ch1
. via magic, once and deduce the lux value.