obniz to be used
Optional onmeasuredThis is a callback function that will be called when data arrives.
The received data is in 0/1 array. And every data represents 0,1 of io in a particular instance.
// Javascript Example
obniz.logicAnalyzer.start({io:0, interval:2, duration:1000}); // start on io0. 1ms interval and 1sec long.
obniz.logicAnalyzer.onmeasured = function(array) {
console.log(array);
}
Rsponse waiting timeout in milliseconds
Static prefixedOptional context: anyOptional 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 the logic analyzer on a given io.
For example, if you want to collect the data after io0 changes every 2ms for 1sec long, set as below.
// Javascript Example
obniz.logicAnalyzer.start({io:0, interval:2, duration:1000}); // start on io0. 2ms interval and 1sec long.
obniz.logicAnalyzer.onmeasured = function(array) {
console.log(array);
}
The trigger is an optional configuration.
Without this, logicAnalyzer recognizes any io level change as trigger and start. Trigger specifies the start position. Value means start value, true/false. Samples means how much that value consists. So, with the below sample code, you will only receive data that start with "0, 0, 0"
// Javascript Example
obniz.logicAnalyzer.start({io:0, interval:2, duration:1000, triggerValue:false, triggerValueSamples:3}); // start on io0. 2ms interval and 1sec long.
obniz.logicAnalyzer.onmeasured = function(array) {
console.log(array);
}
Generated using TypeDoc
LogicAnalyzer records samples read from io periodically. This is useful for digital bus signal check.
Only one LogicAnalyzer can be used per obniz Board.
How it works
LogicAnalyzer starts logging by a trigger. The default trigger is "value change".
When it occurs, data will be recorded for a desired duration. After that is done, LogicAnalyzer starts monitoring changes in io (= continue working). One sample becomes one 1/0.
Sampling interval and duration can be configured. For example, if interval is 1 ms and duration is 800ms, you will get 800 arrays of data. The data will be in multiples of 8.