A node implementation for communicating with the E-Stim Systems 2B Power Box.
const Serialport = require('serialport');
const Readline = require('@serialport/parser-readline');
const Estim2B = require('estim2b');
const port = new Serialport('/dev/ttyUSB0');
port.on('open', function () {
console.log('Established connection');
}).on('error', function (err) {
console.log('Error -> ' + err.message);
});
const instance = new Estim2B(port, new Readline());
instance.setMode(Estim2B.MODE_RANDOM);
There are some unit tests.
$ yarn test