@johntalton/aw9523
v2.0.1
Published
An LED friendly, but also generally useful, Gpio device.
Readme
AW9523
An LED friendly, but also generally useful, Gpio device.
Example
Individual Pins need to be set to LED Mode in order to use Dimming
import { I2CAddressedBus } from '@johntalton/and-other-delights'
import { AW9523, DEFAULT_ADDRESS, SET } from '@johntalton/aw9523'
const bus = /* I2CBus */
const aBus = new I2CAddressBus(bus, DEFAULT_ADDRESS)
const device = new AW9523(device)
const id = await device.getId()
const port = 0
const pin = 2
const dim = 42
const { mode } = await device.getMode(port)
mode[pin] = SET // update mode array for this Pin
await device.setMode(port, mode)
await device.setDimming(port, pin, dim)
