Module to send control signals. Currently only on neonious one.
Allows to send an signal with a length of up to 2 ^ 32 nanoseconds (a bit over 4 seconds)
to up to 8 pins, with up to 6 defined points in time(events) when the pins can individually
be turned on or off. The points in time are defined in nanoseconds, but final the resolution
is 33.333... nanoseconds.
Members
(static) EVENT_1
First, lowest, event
(static) EVENT_8
Highest possible event
(static) ONESHOT
If set as flag in call to send(), the signal only runs once.
(static) RESTART
If set as flag in call to send(), the signal runs in a loop till another signal is sent or clear() is called.
Signal restarts after highest defined event, so in this the highest event should be the latest event.
Methods
(static) clear()
Stops any still running signal. The callback given to send() is called.
(static) send(flags, pins, eventNanoSecs, callbackopt)
Sends the given signal. If a signal is already running, it is stopped, the callback given
to send() for the last signal is called, and the new signal is sent.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
flags |
ONESHOT | RESTART | shall the signal repeat itself? | |||||||||||||
pins |
Array | array with one object per pin used
Properties
|
|||||||||||||
eventNanoSecs |
Array.<Number> | array with numbers of the points in time in the unit nanoseconds of the used events. The first number is for EVENT_1, the second for EVENT_2, and so on | |||||||||||||
callback |
SignalDoneCallback |
<optional> |
called when the signal is stopped, either because it was completed or interrupted with another signal |
Type Definitions
SignalDoneCallback(errnullable, isCompletedopt)
Callback which is called when a signal is stopped, either because it was completed or interrupted with another signal
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
optional error. If not null, the next parameters are not set |
isCompleted |
boolean |
<optional> |
true, if signal completed, false if signal was interrupted |