An Event Emitter.
Constructor
Clears all event listeners, if all is set to true, it even clears the
EVENT_CLEAR listener.
| Parameter | Type | Description |
|---|---|---|
| all | bool |
whether to clear all (default: false) |
Sets up a listener for an event.
| Parameter | Type | Description |
|---|---|---|
| event | int16_t |
event id (numeric value, from 1 to 2048, or EEType) |
| function | function |
function accepting int16_t and float arguments |
Removes a listener from an event.
| Parameter | Type | Description |
|---|---|---|
| event | int16_t |
event id (numeric value, from 1 to 2048, or EEType) |
| function | function |
function accepting int16_t and float arguments |
Returns the count of listeners for an event.
| Parameter | Type | Description |
|---|---|---|
| event | int16_t |
event id (numeric value, from 1 to 2048, or EEType) |
Returns:
int16_t - number of listeners for the event.
Emits an event to all listeners.
| Parameter | Type | Description |
|---|---|---|
| event | int16_t |
event id (numeric value, from 1 to 2048, or EEType) |
| value | float |
value to emit to the listeners |
These are predefined events that will emit by default:
EVENT_CLEAR - when clear() calledEVENT_FIRST - emitted on first eventEVENT_EVEN - emitted on all even eventsEVENT_ODD - emitted on all odd events