Module: signal

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.
Source:

Members

(static) EVENT_1

First, lowest, event
Source:

(static) EVENT_8

Highest possible event
Source:

(static) ONESHOT

If set as flag in call to send(), the signal only runs once.
Source:

(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.
Source:

Methods

(static) clear()

Stops any still running signal. The callback given to send() is called.
Source:

(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
Name Type Description
index Number pin number
setEvents EVENT_1 | EVENT_2 | EVENT_3 | EVENT_4 | EVENT_5 | EVENT_6 | EVENT_7 | EVENT_8 binary OR of events which set the pin to high level
clearEvents EVENT_1 | EVENT_2 | EVENT_3 | EVENT_4 | EVENT_5 | EVENT_6 | EVENT_7 | EVENT_8 binary OR of events which set the pin to low level
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
Source:

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
Source: