Has anyone ever tried to control the braccio with firmata? I am using firmata.js but the servoWrite function has no effect on the servos.
The pins are set correctly to SERVO mode. So, I checked with the oscilloscope and saw that the power pin on the braccio shield does not hold at 5V when I start running StandardFirmata on the Arduino, but it holds when I run a script with the braccio library. The PWM signal is fine in both cases.
Should I try to connect the servos directly on Arduino without the shield?
I don't know if it helps but here is the js code:
const Board = require('firmata');
const serialport = require('serialport');
Board.requestPort(function (error, port) {
if (error) {
console.log(error);
return;
}
board = new Board(port.comName, { samplingInterval: 1000 });
board.on('open', function () {
console.log(' board opened');
alert('board opened')
});
board.on('ready', function () {
console.log(' board ready');
board.pinMode(11,board.MODES.SERVO);
board.pinMode(10,board.MODES.SERVO);
board.pinMode(9, board.MODES.SERVO);
board.pinMode(6, board.MODES.SERVO);
board.pinMode(5, board.MODES.SERVO);
board.pinMode(3, board.MODES.SERVO);
board.servoWrite(11,60);
board.servoWrite(10,85);
board.servoWrite(9,85);
board.servoWrite(6,85);
board.servoWrite(5,85);
board.servoWrite(3,60);
});
});