bot-io
Version:
ADC, GPIO, PWM, UARTs, and more on the BeagleBone Black.
27 lines (19 loc) • 486 B
JavaScript
;
var bot = require('../'),
out = new bot.Gpio(bot.pins.p8_14);
function test() {
var time = process.hrtime(),
state = 0,
opsPerSec,
ops;
for (ops = 0; ops !== 100000; ops += 1) {
out.value(state ^= 1);
}
time = process.hrtime(time);
opsPerSec = Math.floor(ops / (time[0] + time[1] / 1E9));
console.log('ok - ' + __filename);
console.log(' ' + opsPerSec + ' output ops per second');
}
out.once('ready', function () {
test();
});