Optional onchangecalled 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
}
Static prefixedOptional context: anyThis 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
Optional fn: ListenerFnOptional context: anyOptional once: booleanAdd a listener for a given event.
Optional context: anyAdd a one-time listener for a given event.
Optional context: anyRemove all listeners, or those of the specified event.
Optional event: stringRemove the listeners of a given event.
Optional fn: ListenerFnOptional context: anyOptional once: booleanThis starts measuring voltage on ioX until end() is called.
obniz.ad0.start(function(voltage){
console.log("changed to "+voltage+" v")
});
Optional callback: ((voltage) => void)called when voltage gets changed.
Generated using TypeDoc
obniz to be used