Generators

Classes that generated data on demand (e.g. via Iterate)

Range

Range<type>(from, to, increment)
new Range(from, to, increment)

Generates integers in the range from to to by increment. The increment is optional and defaults to 1. Combine with Iterate to generate a stream.

Producers

Classes that produce a stream of data

Interval

Interval<type>(millis)
new Interval(millis)

Produces integers from 0 on every millis milliseconds.

Repeat

Repeat<type>(value)
new Repeat(value)

Produces value every cycle.

Inputs

Classes that receive or sample input data

AnalogIn

AnalogIn<type>(pin)
N/A

Reads analog values from an ADC pin.

BitIn

BitIn<type>(pin)
N/A

Reads values from a digital pin.

GpioSerial

GpioSerial(rxPin, txPin, baud)
N/A

Reads serial input from rxPin and outputs char values. A txPin is required, and will be put in output mode, but is never set.

Outputs

Classes that send or output data

AnalogOut

AnalogOut<type>(pin)
N/A

Writes values to a PWM pin.

BitOut

BitOut<type>(pin)
N/A

Writes values to a digital pin.

Console

Console<type>(baud)
new Console()

C++: Writes value to the serial output at the given baud. Javascript: Writes value to the console.

HttpPost

HttpPost(transport, host, port, path, numHeaders, headers)
N/A

Sends data to an HTTP endpoint using the HTTP POST method using transport (e.g. an instance of WiFiClient). Optional headers are provided as n array of strings.

MqttPub

MqttPub<type>(transport, host, port, topic, clientId, username, password, keepAlive)
N/A

Publishs data to an MQTT endpoint with QOS 0. The username, password, and keepAlive parameters are optional.

SocketIO

N/A
new SocketIO(io, event)

Sends data to a WebSocket via the socket.io module io with the event name event.

Consumers

Consume

Consume<type>(function)
new Consume(function)

Calls the function for each input value with that value as an argument.