<PAL_NOTICE>
<PAL_NOTICE>
Board BEHAVIOR for NOTICE PAL.
In addition to common definition plus the ability to handle sensors on the board.
LED driver PCA9632
Accelerometer MC3630
member object
sns_PCA9632
[PCA9632 device](... /... /sensor_object/pca9632-leddoraiba.md) object. The board definition performs Wire initialization and device initialization. In principle, it is controlled using the PCA9632 operation method described below.
It is not possible to continuously draw a large current from a CR2032 coin cell. In this board definition, the maximum illuminance setting in normal operation is set at a PWM duty ratio of approximately 50%, but even at this setting, overload effects may be apparent. Adjust the combination of LEDs, illumination intensity, and blinking according to the operating requirements.
When using coin cell batteries, periodic, momentary flashing can mitigate the effects of large currents.
For example, a setting that allows the LED to flash for 20 ms every second or so will not only maintain sufficient visual brightness to mitigate the above effects, but will also reduce battery drain. ) {endhint %}
sns_MC3630
MC3630 sensor object. The board definition includes SPI initialization, MC3630 device initialization, and MC3630 interrupt processing. Various processes are handled by sns_MC3630
.
PCA9632-definition
Lighting Status
Definition | Meaning |
---|---|
| OFF |
| On (PWM illuminance control) |
| Blinking |
| Do not change |
LED identification sub
Definition | Meaning |
---|---|
| LED Red |
| LED Green |
| LED Green |
| LED White |
Register Setting Definition
Definition | Meaning |
---|---|
| PMW register set value for standard illuminance (1/2 of all lights are standard) |
| PWM register set value for boosting |
PCA9632-operating method
Master Switch
NOTICE PAL has a FET switch at the rear of the PCA9632 output. The LED will not light unless this switch is turned ON.
Change of lighting status
Set individual LEDs to off, on, or blinking.
set_leds() changes the lighting status of all LEDs. Parameters are lighting statePAL_NOTICE::LED_OFF
PAL_NOTICE::LED_ON
PAL_NOTICE::LED_BLINK
PAL_NOTICE::LED_NOP
.
Light illumination control
Specifies the PWM duty ratio (LED lighting brightness).
set_led_brightness_? _reg()
and set_leds_brightness_reg()
specify the register value directly. 0...255 is specified and the lighting will be the ratio duty/256
.
set_led_brightness_?1000()
and set_leds_brightness1000()
specify a duty ratio of 0..1000, where 0 corresponds to no light and the larger the value, the brighter (longer lighting interval). If boost
is set to false
, the register value is 127 when 1000 is specified. If boost
is set to true
, the register value will be 255.
Since PAL is operated by a coin cell battery, the specified maximum value is set to a duty ratio of approximately 50%.
The final setting is assigned to the register value, so even if 0...1000 steps are specified, the actual control value will be the precision of the register value.
Blinking Control
LEDs with PAL_NOTICE::LED_BLINK
will blink with the specified period and lighting duration ratio.
Blinking patterns cannot be specified individually.
Brightness can also be controlled since the LEDs are turned on at the PWM duty ratio specified in the lighting illuminance setting above.
set_blink_cycle_ms()
blinks for a period of time specified by x
.
set_blink_duty1000()sets
xto 0..1000 and blinks for
cycle*x/1000` as the lighting period.
The final setting is assigned to the register value, so even if you specify 0...1000 steps, the actual control value will be the precision of the register value.
Test lighting
Turns on the 4 LEDs for a very short period of time. After lighting, the master switch is turned on (set_led_master_sw_on()
).
最終更新