Git Product home page Git Product logo

brickpi-nodejs's People

Contributors

lmclupr avatar rickbullotta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

brickpi-nodejs's Issues

"npm install brickpi-raspberry" fails

On my Raspberry Pi with BrickPi, this command:

npm install brickpi-raspberry

fails:

$ npm install brickpi-raspberry
npm http GET https://registry.npmjs.org/brickpi-raspberry

npm ERR! Error: failed to fetch from registry: brickpi-raspberry
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.g (events.js:156:14)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/pi/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 4.1.13-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "brickpi-raspberry"
npm ERR! cwd /home/pi
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: brickpi-raspberry
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/npm-debug.log
npm not ok

Node.js and brickpi3

Hey,
This 'brickpi-raspberry' node module works with older version of Brickpi kit but doesn't work with BrickPi3 because of change in communication i guess.Any solutions to make this module work with brickpi 3.Thanks

Does this work with the Brickpi3?

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);
.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.