AnalogActor
Base class for PWM output components with 0–255 value control (fade, pulse, blink animations).
#Extends
#Extended by
- LedDimmable
- ServoMotor
#Constructors
#Constructor
new AnalogActor(options): AnalogActor;#Parameters
| Parameter | Type |
|---|---|
options | AnalogActorOptions |
#Returns
AnalogActor
#Overrides
#Accessors
#isAnimating
#Get Signature
get isAnimating(): boolean;Check if an animation is running
#Returns
boolean
#Inherited from
#isOn
#Get Signature
get isOn(): boolean;Check if the component is currently on (above minimum value)
#Returns
boolean
#Overrides
#value
#Get Signature
get value(): T | undefined;Get the current value of the component.
#Returns
T | undefined
#Inherited from
#Methods
#blink()
blink(interval?): this;Blink the component at a given interval (Arduino-side animation)
#Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
interval | number | 500 | Blink interval in milliseconds (default: 500) |
#Returns
this
#Inherited from
#cleanup()
cleanup(): void;Cleanup resources when board closes. Override in subclasses to add component-specific cleanup.
#Returns
void
#Inherited from
#fadeTo()
fadeTo(targetValue, duration?): this;Fade to a target value over time (Arduino-side animation)
#Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
targetValue | number | undefined | Target brightness value |
duration | number | 1000 | Duration in milliseconds (default: 1000) |
#Returns
this
#handleData()
handleData(data): void;Handle incoming data from Arduino via serial protocol. Called by Board when data arrives for this component's ID.
#Parameters
| Parameter | Type |
|---|---|
data | unknown |
#Returns
void
#Inherited from
#off()
off(): this;Turn the component off to min value
#Returns
this
#Overrides
#on()
#Call Signature
on(): this;Turn the component on to max value (no arguments) or register an event listener.
#Returns
this
#Overrides
#Call Signature
on(event, listener): this;Turn the component on to max value (no arguments) or register an event listener.
#Parameters
| Parameter | Type |
|---|---|
event | "change" |
listener | (value) => void |
#Returns
this
#Overrides
#once()
#Call Signature
once<K>(event, listener): this;Register a one-time event listener with typed events.
#Type Parameters
| Type Parameter |
|---|
K extends keyof ComponentEventMap<number> |
#Parameters
| Parameter | Type |
|---|---|
event | K |
listener | ComponentEventMap<number>[K] |
#Returns
this
#Inherited from
#Call Signature
once(event, listener): this;Register a one-time event listener with typed events.
#Parameters
| Parameter | Type |
|---|---|
event | string | symbol |
listener | (...args) => void |
#Returns
this
#Inherited from
#pulse()
pulse(interval?): this;Pulse the component at a given interval (Arduino-side animation)
#Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
interval | number | 1000 | Pulse interval in milliseconds (default: 1000) |
#Returns
this
#removeAllListeners()
#Call Signature
removeAllListeners<K>(event?): this;Remove all listeners for a specific event, or all events if no event specified.
#Type Parameters
| Type Parameter |
|---|
K extends keyof ComponentEventMap<number> |
#Parameters
| Parameter | Type |
|---|---|
event? | K |
#Returns
this
#Inherited from
DigitalActor.removeAllListeners
#Call Signature
removeAllListeners(event?): this;Remove all listeners for a specific event, or all events if no event specified.
#Parameters
| Parameter | Type |
|---|---|
event? | string | symbol |
#Returns
this
#Inherited from
DigitalActor.removeAllListeners
#removeListener()
#Call Signature
removeListener<K>(event, listener): this;Remove an event listener with typed events.
#Type Parameters
| Type Parameter |
|---|
K extends keyof ComponentEventMap<number> |
#Parameters
| Parameter | Type |
|---|---|
event | K |
listener | ComponentEventMap<number>[K] |
#Returns
this
#Inherited from
#Call Signature
removeListener(event, listener): this;Remove an event listener with typed events.
#Parameters
| Parameter | Type |
|---|---|
event | string | symbol |
listener | (...args) => void |
#Returns
this
#Inherited from
#set()
set(value): this;Set the value of the component
#Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | Value between minValue and maxValue (0-255 by default) |
#Returns
this
#Overrides
#setBoard()
setBoard(board): void;#Parameters
| Parameter | Type |
|---|---|
board | Board |
#Returns
void
#Inherited from
#stop()
stop(): this;Stop any running animation (blink, pulse)
#Returns
this
#Inherited from
#toggle()
toggle(): this;Toggle the component between min and max values
#Returns
this
#Overrides
#updateOptions()
updateOptions(options): void;#Parameters
| Parameter | Type |
|---|---|
options | { invert?: boolean; } |
options.invert? | boolean |
#Returns
void