obniz to be used
Rsponse waiting timeout in milliseconds
This allows you to change output drive method. By default, it is set as push-pull 5v.
// Javascript Example
obniz.io0.output(true); // output push-pull 5v
obniz.io1.drive("3v");
obniz.io1.output(true); // output push-pull 3v
obniz.io2.pull("5v");
obniz.io2.drive("open-drain");
obniz.io2.output(true); // output open-drain with 5v pull-up
Calls each of the listeners registered for a given event.
This ends output/input on ioX.
This function is effective only when using ioX.output() or ioX.input(). This won't be called when AD/UART/etc are used. Pull-up down also will not affected.
// Javascript Example
obniz.io0.output(true)
obniz.io0.end();
Return an array listing the events for which the emitter has registered listeners.
Make ioX to input mode. Callback function will be called when io changes its input value.
Make ioX to input mode.
And this will return the current input value. It pauses the process until the value is returned.
// Javascript Example
var value = await obniz.io0.inputWait();
console.log(value);
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Add a listener for a given event.
Add a one-time listener for a given event.
Make ioX to output mode and put out 1 or 0.
// Javascript Example
obniz.io1.output(true); // io1 is 5v
obniz.io2.output(1); // io2 is 5v
obniz.io3.drive("3v");
obniz.io3.output(1); // io3 is around 3v.
output value
This enables/disables internal weak pull up/down resistors.
// Javascript Example
obniz.io0.pull("3v");
obniz.io0.drive("open-drain"); // output open-drain
obniz.io0.output(false);
Remove all listeners, or those of the specified event.
Remove the listeners of a given event.
Generated using TypeDoc
General purpose IO This is available on each io (for obniz Board series, it's io0 to io11)