obniz to be used
called when voltage gets changed.
Rsponse waiting timeout in milliseconds
The value will be stored in the value variable.
Note: This property stores the last received value. NOT the value when you read this property.
obniz.ad0.start();
while(true) {
console.log("changed to "+obniz.ad0.value+" v")
await obniz.wait(10); // 10ms wait
}
Calls each of the listeners registered for a given event.
This stops measuring voltage on ioX.
obniz.ad0.start();
obniz.ad0.end();
Return an array listing the events for which the emitter has registered listeners.
This measures the voltage just once and returns its value. This function will pause until ad result arrives to your js.
obniz.io0.output(true)
var voltage = await obniz.ad0.getWait();
obniz.io0.output(false)
console.log(""+voltage+" should be closed to 5.00");
measured voltage
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.
Remove all listeners, or those of the specified event.
Remove the listeners of a given event.
This starts measuring voltage on ioX until end() is called.
obniz.ad0.start(function(voltage){
console.log("changed to "+voltage+" v")
});
called when voltage gets changed.
Generated using TypeDoc