Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controlling Tinkerkit's Braccio with firmata.js #186

Open
cnizo opened this issue Apr 6, 2018 · 2 comments
Open

Controlling Tinkerkit's Braccio with firmata.js #186

cnizo opened this issue Apr 6, 2018 · 2 comments

Comments

@cnizo
Copy link

cnizo commented Apr 6, 2018

Hello!
I am sorry if this is an obvious question, but I have been trying to control Braccio from Tinkerkit with firmata.js, but the servoWrite function has no effect on it.
I have uploaded StandardFirmata on Arduino UNO. From the Braccio library for Arduino I saw that the servos are attached to pins 11, 10, 9, 6, 5 and 3, so can't I just use servoWrite with this pins and the desired angles?

Thanks!

@dtex
Copy link
Contributor

dtex commented Apr 8, 2018

It certainly looks like it should work. Could you share your code? It might make it easier to diagnose.

@cnizo
Copy link
Author

cnizo commented Apr 9, 2018

This is what I tried to do. I dig a little and when I run the code the function "Board.prototype.pwmWrite" on firmata.js is called.

`var Board = require('firmata');

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,85);
    board.servoWrite(10,85);
    board.servoWrite(9,85);
    board.servoWrite(6,85);
    board.servoWrite(5,85);
    board.servoWrite(3,60);
  });
});`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants