microFET2
Nodejs library to access the microFET 2 data
var MicroFET2 = require('electron-microfet2');
var sensor = new MicroFET2();
//listen for device found event and connect
sensor.on('found', (devices) => {
devices.forEach((device) => {
sensor.connect(device.id, device.name, device.port);
});
});
//listen for connection and start streaming
sensor.on('connect', (device) => {
console.log("microFET2 connected");
});
//listen for data
sensor.on('data', (data) => {
console.log(data);
});
//look for devices to connect to
sensor.detect();
//close the connection after 5 seconds
setTimeout(function(){
sensor.disconnect();
console.log("microFET2 disconnected");
}, 5000);
Serial Data Stream For MicroFET 2, ErgoFET 150 and ErgoFET 300
- 9600 baud, 8 data, 1 stop, no parity
- 4 bytes are sent
- byte.bit(0-7) example: 3.2 is set - third byte bit 2 set
Byte 1 = 255
2.7 1 NA
2.6 NA
2.5 1=low range 0=high range
2.4-2.1 NA
2.0 1=force reading negative (tension) 0=force reading positive (compression) ErgoFET only
byte 3 � Most significant 2 digits (99 maximum)
Byte 4 � least significant 2 digits (99 maximum)
Example: byte 3=12 and byte 4=26 then the force reading is 122.6 pounds