Skip to content

Does this work with the Brickpi3? #5

@ppinto

Description

@ppinto

I tried setting this up on a brickpi3, and a brickpi seems to work on the brickpi but get's this error on the brickpi3

root@dpcbot03:~/jscode# node bot1.js
rx Timeout

Error: timed out
at null. (/root/node_modules/brickpi-raspberry/Brickpi.js:46:18)
at /root/node_modules/brickpi-raspberry/Driver.js:36:6
at /root/node_modules/brickpi-raspberry/node_modules/async/lib/async.js:151:21
at null._onTimeout (/root/node_modules/brickpi-raspberry/Driver.js:52:2)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

here's the code
var brickpi = require('brickpi-raspberry');
.
var robot = new brickpi.BrickPi();
var motorA = new brickpi.Motor({port: brickpi.PORTS.MA, name: 'motorA'});
var motorB = new brickpi.Motor({port: brickpi.PORTS.MB, name: 'motorB'});
.
robot.addMotor(motorA).addMotor(motorB).setup();
.
robot.on('ready', function() {
motorA.resetPosition();
motorB.resetPosition();
robot.run();
.
motorA.start(100).moveTo(5000, function(err) {
// called when motorA has reached 5000 ticks (2500 degrees in rotation).
});
});
.
setTimeout(function() {
motorB.start(50);
}, 3000);
.
setTimeout(function() {
motorB.stop();
}, 5000);
.
setTimeout(function() {
robot.stop();
}, 10000);
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions