PCA9632 - LED Driver
LED driver used for NOTICE PAL.
The control on the NOTICE PAL is done via board(BRD) PAL_NOTICE.
1.Wire.begin()
: Initialize bus 2 .setup()
: Initialize the class object .reset()
: Initialization of the driver 4. 4. various procedures
This is a 4-channel LED driver.
Each channel can specify 4 states: off, all lights on, PWM on, and blinking.
Each channel can control illuminance (PWM) independently.
All chs designated as blinking have the same blinking pattern.
When blinking, illuminance can be controlled for each channel individually by PWM
Before calling the setup()
method, Wire must be put into operation state by Wire.begin()
.
Keep the Wire bus in the operating state just before sleep (the Wire is automatically restored after sleep recovery).
#include <SNS_PCA9632>
and declaration of SNS_PCA9632
class object is required.
In the above example, LEDs 1 and 3 are turned on by PWM control.
Be careful of the current value consumed by the driver when lighting up.
Specify i2c_addr
in the constructor.
If you define a class object in a global declaration, the constructor will not be called, so call setup()
.
Initializes the device. \0x0} Writes {0x81, 0x35, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x0B, 0x00}
starting with register address 0x0.
Write a value to the MODE2 register.
Setting b_pow_on
to true
will cause normal operation, setting it to false
will cause sleep.
Determines the blinking (group PWM) period.
If u8var
is specified, the period is (u8var+1)/24
[s].
The u16ms
specifies the period in œms.
Determines the duty ratio of blinking (group PWM). The lighting period is u8duty/256
, where 0 corresponds to lights off and 255 corresponds to all lights on.
brightness (duty ratio of PMW control).
port
specifies the target LED (SNS_PCA9632::LED1..4
).
... duty
specifies 0..255, and the LEDs are turned on with the ratio duty/256
.
Specify the brightness (duty ratio of PMW control) for all LEDs.
p1,p2,p3,p4
specifies 0...255 in duty for LED1...4. The LEDs turn on at a ratio duty/256
.
Changes the lighting state of all LEDs.
u8led1..4
specifies the state of LED1..4 in order.
The states that can be specified are as follows.
Returns true
if a device exists on the I2C bus.
Displays the value of register (0x0-0x8).
Content | |
---|---|
SNS_PCA9632::LED_OFF
OFF
SNS_PCA9632::LED_ON
All lights on
SNS_PCA9632::LED_PWM
Illumination control(PWM)
SNS_PCA9632::LED_BLINK
Blink control (group PWM)
SNS_PCA9632::LED_NOP
Do not change state