hybridgroup / cylon

JavaScript framework for robotics, drones, and the Internet of Things (IoT)
https://cylonjs.com
Other
4.2k stars 361 forks source link

cylonjs not working when i use motor shield for Arduino #222

Closed neonag closed 10 years ago

neonag commented 10 years ago

i had a code running in cylonjs on a bread board with 2 l293d connected to arduino but when i tried using the motor shield nothing seems to work .. need help on this !!

solojavier commented 10 years ago

Could you provide cylon and cylon-firmata version numbers and what OS are you using?

It will also help to know what code are you running and how you have it wired...

deadprogram commented 10 years ago

Also which motor shield, please.

neonag commented 10 years ago

@solojavier
this is the error i get when i install cylon-firmata ERR! peerinvalid The package cylon does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer cylon-firmata@0.14.0 wants cylon@>= 0.16.0 < 1 npm ERR! peerinvalid Peer cylon-gpio@0.15.1 wants cylon@>= 0.15.0 < 1 npm ERR! peerinvalid Peer cylon-i2c@0.12.1 wants cylon@>= 0.15.0 < 1

npm ERR! System Darwin 12.5.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "cylon-firmata" npm ERR! cwd /Users/neo npm ERR! node -v v0.10.22 npm ERR! npm -v 1.3.14 npm ERR! code EPEERINVALID npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/neo/npm-debug.log npm ERR! not ok code 0

and the code is as below

var Cylon = require('cylon');

Cylon.robot({ connections: [{ name: 'leapmotion', adaptor: 'leapmotion', port: '127.0.0.1:6437' }, { name: 'arduino', adaptor: 'firmata', port: '/dev/tty.usbmodem621' }],

devices: [{ name: 'leapmotion', driver: 'leapmotion', connection: 'leapmotion' }, { name: 'led', driver: 'led', pin: 13, connection: 'arduino' }, { name: 'led1', driver: 'led', pin: 12, connection: 'arduino' }, { name: 'led2', driver: 'led', pin: 11, connection: 'arduino' }, { name: 'led3', driver: 'led', pin: 10, connection: 'arduino' } ],

work: function(my) { my.leapmotion.on('hand', function(hand) { var pitchRadians = hand.pitch(); var rollRadians = hand.roll();

if(pitchRadians > 0.2){ my.led.turnOn(); my.led3.turnOn();

} else { my.led.turnOff(); my.led3.turnOff();

}

if(pitchRadians < -0.2){ my.led1.turnOn(); my.led2.turnOn();

} else { my.led1.turnOff(); my.led2.turnOff();

} if(rollRadians > 0.3){ my.led1.turnOn(); my.led3.turnOn();

} else { my.led1.turnOff(); my.led3.turnOff();

}if(rollRadians < -0.3) { my.led.turnOn(); my.led2.turnOn();

} else { my.led.turnOff(); my.led2.turnOff(); }

if( pitchRadians > 0.1){ my.led.turnOn(); my.led3.turnOn(); } else { my.led.turnOff(); my.led3.turnOff(); }

if (pitchRadians < -0.1 ) { my.led1.turnOn(); my.led2.turnOn(); } else { my.led1.turnOff(); my.led2.turnOff(); } */

if(rollRadians > 0.3){ my.led1.turnOn(); my.led3.turnOn();

} else { my.led1.turnOff(); my.led3.turnOff();

} if(rollRadians < -0.3) { my.led.turnOn(); my.led2.turnOn();

} else { my.led.turnOff(); my.led2.turnOff(); } }); } }).start();

@deadprogram

i am using DK Electronics Arduino motor shield

solojavier commented 10 years ago

Seems like you need to update cylon to 0.16, please do:

npm update cylon
neonag commented 10 years ago

@solojavier after updating both i am getting the following for the versions cylon-firmata 1.3.14 cylon 1.3.14

solojavier commented 10 years ago

run: npm list cylon and npm list cylon-firmata to get package versions... Do you still get the same error?

neonag commented 10 years ago

@solojavier thanks now i get these when i run those commands for npm list cylon ── cylon@0.17.0 ├─┬ cylon-firmata@0.14.0 │ ├── cylon@0.16.0 │ ├─┬ cylon-gpio@0.16.0 │ │ └── cylon@0.16.0 │ └─┬ cylon-i2c@0.13.0 │ └── cylon@0.16.0 ├─┬ cylon-gpio@0.15.1 peer invalid │ └── cylon@0.15.1 ├─┬ cylon-i2c@0.12.1 peer invalid │ └── cylon@0.15.1 └─┬ cylon-leapmotion@0.10.0 └── cylon@0.15.1

for npm list cylon-firmata cylon-firmata@0.14.0

solojavier commented 10 years ago

So the error should be gone now, can we close this issue?

stewart commented 10 years ago

@neonag your dependency tree appears to be a little bit messed up due to the new release, can you reinstall everything with:

$ npm install cylon-firmata cylon-leapmotion

And then let us know what the result of npm list cylon is again please?

neonag commented 10 years ago

@stewart

this is the error i get after i did the install as you said

── cylon@0.17.0 ├─┬ cylon-firmata@0.14.0 │ └── cylon@0.16.0 ├─┬ cylon-gpio@0.15.1 peer invalid │ └── cylon@0.15.1 ├─┬ cylon-i2c@0.12.1 peer invalid │ └── cylon@0.15.1 └─┬ cylon-leapmotion@0.11.0 └── cylon@0.16.0

npm ERR! peer invalid: cylon-gpio@0.15.1 /Users/neo/node_modules/cylon-gpio npm ERR! peer invalid: cylon-i2c@0.12.1 /Users/neo/node_modules/cylon-i2c npm ERR! not ok code 0

stewart commented 10 years ago

Hmm, that's really weird. Can I get the output of just npm list (to get everything)?

Sorry for the inconvenience, think it's a dependency issue to do with cylon-firmata.

neonag commented 10 years ago

no problem there is no inconvenience i need to reach my goal of making cylonJS work with firmata if i succeed in overall my project i can brag and introduce cylonJS usage in my university

├─┬ cylon@0.17.0 │ ├── async@0.7.0 │ ├─┬ body-parser@1.3.0 │ │ ├── bytes@1.0.0 │ │ ├── qs@0.6.6 │ │ ├── raw-body@1.1.6 │ │ └─┬ type-is@1.2.0 │ │ └── mime@1.2.11 │ ├─┬ express@4.4.1 │ │ ├─┬ accepts@1.0.2 │ │ │ ├── mime@1.2.11 │ │ │ └── negotiator@0.4.5 │ │ ├── buffer-crc32@0.2.1 │ │ ├── cookie@0.1.2 │ │ ├── cookie-signature@1.0.3 │ │ ├── debug@0.8.1 │ │ ├── escape-html@1.0.1 │ │ ├── fresh@0.2.2 │ │ ├── merge-descriptors@0.0.2 │ │ ├── methods@1.0.1 │ │ ├── parseurl@1.0.1 │ │ ├── path-to-regexp@0.1.2 │ │ ├─┬ proxy-addr@1.0.0 │ │ │ └── ipaddr.js@0.1.2 │ │ ├── qs@0.6.6 │ │ ├── range-parser@1.0.0 │ │ ├─┬ send@0.4.1 │ │ │ ├── finished@1.1.4 │ │ │ └── mime@1.2.11 │ │ ├── serve-static@1.2.1 │ │ ├─┬ type-is@1.2.0 │ │ │ └── mime@1.2.11 │ │ └── utils-merge@1.0.0 │ └── robeaux@0.2.0 ├─┬ cylon-cli@0.7.0 │ ├── ejs@0.8.8 │ ├─┬ globule@0.2.0 │ │ ├─┬ glob@3.2.11 │ │ │ ├── inherits@2.0.1 │ │ │ └─┬ minimatch@0.3.0 │ │ │ ├── lru-cache@2.5.0 │ │ │ └── sigmund@1.0.0 │ │ ├── lodash@2.4.1 │ │ └─┬ minimatch@0.2.14 │ │ ├── lru-cache@2.5.0 │ │ └── sigmund@1.0.0 │ └─┬ restler@3.2.2 │ ├── iconv-lite@0.2.11 │ ├── qs@0.6.6 │ ├─┬ xml2js@0.4.0 │ │ ├── sax@0.5.8 │ │ └─┬ xmlbuilder@2.2.1 │ │ └── lodash-node@2.4.1 │ └── yaml@0.2.3 ├─┬ cylon-firmata@0.14.0 │ ├─┬ cylon@0.16.0 │ │ ├── async@0.7.0 │ │ ├─┬ body-parser@1.3.0 │ │ │ ├── bytes@1.0.0 │ │ │ ├── qs@0.6.6 │ │ │ ├── raw-body@1.1.6 │ │ │ └─┬ type-is@1.2.0 │ │ │ └── mime@1.2.11 │ │ ├─┬ express@4.4.1 │ │ │ ├─┬ accepts@1.0.2 │ │ │ │ ├── mime@1.2.11 │ │ │ │ └── negotiator@0.4.5 │ │ │ ├── buffer-crc32@0.2.1 │ │ │ ├── cookie@0.1.2 │ │ │ ├── cookie-signature@1.0.3 │ │ │ ├── debug@0.8.1 │ │ │ ├── escape-html@1.0.1 │ │ │ ├── fresh@0.2.2 │ │ │ ├── merge-descriptors@0.0.2 │ │ │ ├── methods@1.0.1 │ │ │ ├── parseurl@1.0.1 │ │ │ ├── path-to-regexp@0.1.2 │ │ │ ├─┬ proxy-addr@1.0.0 │ │ │ │ └── ipaddr.js@0.1.2 │ │ │ ├── qs@0.6.6 │ │ │ ├── range-parser@1.0.0 │ │ │ ├─┬ send@0.4.1 │ │ │ │ ├── finished@1.1.4 │ │ │ │ └── mime@1.2.11 │ │ │ ├── serve-static@1.2.1 │ │ │ ├─┬ type-is@1.2.0 │ │ │ │ └── mime@1.2.11 │ │ │ └── utils-merge@1.0.0 │ │ └── robeaux@0.2.0 │ ├── cylon-gpio@0.16.0 │ ├── cylon-i2c@0.13.0 │ └─┬ firmata@0.3.3 │ ├── browser-serialport@1.0.6 │ └─┬ serialport@1.4.5 │ ├── async@0.9.0 │ ├── bindings@1.2.1 │ ├── nan@1.3.0 │ ├─┬ node-pre-gyp@0.5.19 │ │ ├─┬ mkdirp@0.5.0 │ │ │ └── minimist@0.0.8 │ │ ├─┬ nopt@2.2.1 │ │ │ └── abbrev@1.0.5 │ │ ├─┬ npmlog@0.0.6 │ │ │ └── ansi@0.2.1 │ │ ├─┬ rc@0.4.0 │ │ │ ├── deep-extend@0.2.10 │ │ │ ├── ini@1.1.0 │ │ │ ├── minimist@0.0.10 │ │ │ └── strip-json-comments@0.1.3 │ │ ├─┬ request@2.36.0 │ │ │ ├── aws-sign2@0.5.0 │ │ │ ├── forever-agent@0.5.2 │ │ │ ├─┬ form-data@0.1.2 │ │ │ │ ├── async@0.2.10 │ │ │ │ └─┬ combined-stream@0.0.4 │ │ │ │ └── delayed-stream@0.0.5 │ │ │ ├─┬ hawk@1.0.0 │ │ │ │ ├── boom@0.4.2 │ │ │ │ ├── cryptiles@0.2.2 │ │ │ │ ├── hoek@0.9.1 │ │ │ │ └── sntp@0.2.4 │ │ │ ├─┬ http-signature@0.10.0 │ │ │ │ ├── asn1@0.1.11 │ │ │ │ ├── assert-plus@0.1.2 │ │ │ │ └── ctype@0.5.2 │ │ │ ├── json-stringify-safe@5.0.0 │ │ │ ├── mime@1.2.11 │ │ │ ├── node-uuid@1.4.1 │ │ │ ├── oauth-sign@0.3.0 │ │ │ ├── qs@0.6.6 │ │ │ ├─┬ tough-cookie@0.12.1 │ │ │ │ └── punycode@1.2.4 │ │ │ └── tunnel-agent@0.4.0 │ │ ├── rimraf@2.2.8 │ │ ├── semver@2.3.0 │ │ ├─┬ tar@0.1.19 │ │ │ ├── block-stream@0.0.7 │ │ │ ├─┬ fstream@0.1.25 │ │ │ │ ├── graceful-fs@2.0.3 │ │ │ │ └── mkdirp@0.3.5 │ │ │ └── inherits@2.0.1 │ │ └─┬ tar-pack@2.0.0 │ │ ├── debug@0.7.4 │ │ ├─┬ fstream@0.1.25 │ │ │ ├── graceful-fs@2.0.3 │ │ │ ├── inherits@2.0.1 │ │ │ └── mkdirp@0.3.5 │ │ ├─┬ fstream-ignore@0.0.7 │ │ │ ├── inherits@2.0.1 │ │ │ └─┬ minimatch@0.2.14 │ │ │ ├── lru-cache@2.5.0 │ │ │ └── sigmund@1.0.0 │ │ ├── graceful-fs@1.2.3 │ │ ├── once@1.1.1 │ │ ├─┬ readable-stream@1.0.27-1 │ │ │ ├── core-util-is@1.0.1 │ │ │ ├── inherits@2.0.1 │ │ │ ├── isarray@0.0.1 │ │ │ └── string_decoder@0.10.25-1 │ │ └── uid-number@0.0.3 │ ├─┬ optimist@0.6.1 │ │ ├── minimist@0.0.10 │ │ └── wordwrap@0.0.2 │ └── sf@0.1.7 ├─┬ cylon-gpio@0.15.1 peer invalid │ └─┬ cylon@0.15.1 │ ├── async@0.7.0 │ ├─┬ body-parser@1.3.0 │ │ ├── bytes@1.0.0 │ │ ├── qs@0.6.6 │ │ ├── raw-body@1.1.6 │ │ └─┬ type-is@1.2.0 │ │ └── mime@1.2.11 │ ├─┬ express@4.4.1 │ │ ├─┬ accepts@1.0.2 │ │ │ ├── mime@1.2.11 │ │ │ └── negotiator@0.4.5 │ │ ├── buffer-crc32@0.2.1 │ │ ├── cookie@0.1.2 │ │ ├── cookie-signature@1.0.3 │ │ ├── debug@0.8.1 │ │ ├── escape-html@1.0.1 │ │ ├── fresh@0.2.2 │ │ ├── merge-descriptors@0.0.2 │ │ ├── methods@1.0.1 │ │ ├── parseurl@1.0.1 │ │ ├── path-to-regexp@0.1.2 │ │ ├─┬ proxy-addr@1.0.0 │ │ │ └── ipaddr.js@0.1.2 │ │ ├── qs@0.6.6 │ │ ├── range-parser@1.0.0 │ │ ├─┬ send@0.4.1 │ │ │ ├── finished@1.1.4 │ │ │ └── mime@1.2.11 │ │ ├── serve-static@1.2.1 │ │ ├─┬ type-is@1.2.0 │ │ │ └── mime@1.2.11 │ │ └── utils-merge@1.0.0 │ └── robeaux@0.2.0 ├─┬ cylon-i2c@0.12.1 peer invalid │ └─┬ cylon@0.15.1 │ ├── async@0.7.0 │ ├─┬ body-parser@1.3.0 │ │ ├── bytes@1.0.0 │ │ ├── qs@0.6.6 │ │ ├── raw-body@1.1.6 │ │ └─┬ type-is@1.2.0 │ │ └── mime@1.2.11 │ ├─┬ express@4.4.1 │ │ ├─┬ accepts@1.0.2 │ │ │ ├── mime@1.2.11 │ │ │ └── negotiator@0.4.5 │ │ ├── buffer-crc32@0.2.1 │ │ ├── cookie@0.1.2 │ │ ├── cookie-signature@1.0.3 │ │ ├── debug@0.8.1 │ │ ├── escape-html@1.0.1 │ │ ├── fresh@0.2.2 │ │ ├── merge-descriptors@0.0.2 │ │ ├── methods@1.0.1 │ │ ├── parseurl@1.0.1 │ │ ├── path-to-regexp@0.1.2 │ │ ├─┬ proxy-addr@1.0.0 │ │ │ └── ipaddr.js@0.1.2 │ │ ├── qs@0.6.6 │ │ ├── range-parser@1.0.0 │ │ ├─┬ send@0.4.1 │ │ │ ├── finished@1.1.4 │ │ │ └── mime@1.2.11 │ │ ├── serve-static@1.2.1 │ │ ├─┬ type-is@1.2.0 │ │ │ └── mime@1.2.11 │ │ └── utils-merge@1.0.0 │ └── robeaux@0.2.0 ├─┬ cylon-leapmotion@0.11.0 │ └─┬ cylon@0.16.0 │ ├── async@0.7.0 │ ├─┬ body-parser@1.3.0 │ │ ├── bytes@1.0.0 │ │ ├── qs@0.6.6 │ │ ├── raw-body@1.1.6 │ │ └─┬ type-is@1.2.0 │ │ └── mime@1.2.11 │ ├─┬ express@4.4.1 │ │ ├─┬ accepts@1.0.2 │ │ │ ├── mime@1.2.11 │ │ │ └── negotiator@0.4.5 │ │ ├── buffer-crc32@0.2.1 │ │ ├── cookie@0.1.2 │ │ ├── cookie-signature@1.0.3 │ │ ├── debug@0.8.1 │ │ ├── escape-html@1.0.1 │ │ ├── fresh@0.2.2 │ │ ├── merge-descriptors@0.0.2 │ │ ├── methods@1.0.1 │ │ ├── parseurl@1.0.1 │ │ ├── path-to-regexp@0.1.2 │ │ ├─┬ proxy-addr@1.0.0 │ │ │ └── ipaddr.js@0.1.2 │ │ ├── qs@0.6.6 │ │ ├── range-parser@1.0.0 │ │ ├─┬ send@0.4.1 │ │ │ ├── finished@1.1.4 │ │ │ └── mime@1.2.11 │ │ ├── serve-static@1.2.1 │ │ ├─┬ type-is@1.2.0 │ │ │ └── mime@1.2.11 │ │ └── utils-merge@1.0.0 │ └── robeaux@0.2.0 ├─┬ johnny-five@0.7.8 │ ├── async@0.2.9 │ ├── colors@0.6.2 │ ├── compulsive@0.3.1 │ ├── descriptor@0.1.0 │ ├── es6-collections@0.2.0 │ ├─┬ firmata@0.3.0 │ │ └── browser-serialport@0.0.4 │ ├── keypress@0.2.1 │ ├── lodash@2.4.1 │ ├── nanotimer@0.3.0 │ ├─┬ optimist@0.5.2 │ │ └── wordwrap@0.0.2 │ ├─┬ serialport@1.2.5 │ │ ├── async@0.1.18 │ │ ├── bindings@1.1.1 │ │ ├─┬ optimist@0.3.7 │ │ │ └── wordwrap@0.0.2 │ │ └── sf@0.1.6 │ ├─┬ socket.io@0.9.16 │ │ ├── base64id@0.1.0 │ │ ├── policyfile@0.0.4 │ │ ├── redis@0.7.3 │ │ └─┬ socket.io-client@0.9.16 │ │ ├─┬ active-x-obfuscator@0.0.1 │ │ │ └── zeparser@0.0.5 │ │ ├── uglify-js@1.2.5 │ │ └── xmlhttprequest@1.4.2 │ └── temporal@0.2.10 ├─┬ leapjs@0.6.0 │ ├── gl-matrix@2.2.1 │ ├── underscore@1.4.4 │ └─┬ ws@0.4.25 │ ├── commander@0.6.1 │ ├── options@0.0.5 │ └── tinycolor@0.0.1 ├── make@0.0.0 ├─┬ phonegap@3.5.0-0.20.4 │ ├── colors@0.6.0-1 │ ├─┬ connect-phonegap@0.11.0 │ │ ├─┬ connect@2.12.0 │ │ │ ├── batch@0.5.0 │ │ │ ├── buffer-crc32@0.2.1 │ │ │ ├── bytes@0.2.1 │ │ │ ├── cookie@0.1.0 │ │ │ ├── cookie-signature@1.0.1 │ │ │ ├── debug@0.8.1 │ │ │ ├── fresh@0.2.0 │ │ │ ├── methods@0.1.0 │ │ │ ├─┬ multiparty@2.2.0 │ │ │ │ ├─┬ readable-stream@1.1.13-1 │ │ │ │ │ ├── core-util-is@1.0.1 │ │ │ │ │ ├── inherits@2.0.1 │ │ │ │ │ ├── isarray@0.0.1 │ │ │ │ │ └── string_decoder@0.10.25-1 │ │ │ │ └── stream-counter@0.2.0 │ │ │ ├── negotiator@0.3.0 │ │ │ ├── pause@0.0.1 │ │ │ ├── qs@0.6.6 │ │ │ ├── raw-body@1.1.2 │ │ │ ├─┬ send@0.1.4 │ │ │ │ ├── mime@1.2.11 │ │ │ │ └── range-parser@0.0.4 │ │ │ └── uid2@0.0.3 │ │ ├── connect-inject@0.3.2 │ │ ├─┬ gaze@0.4.3 │ │ │ └─┬ globule@0.1.0 │ │ │ ├─┬ glob@3.1.21 │ │ │ │ ├── graceful-fs@1.2.3 │ │ │ │ └── inherits@1.0.0 │ │ │ ├── lodash@1.0.1 │ │ │ └─┬ minimatch@0.2.14 │ │ │ ├── lru-cache@2.5.0 │ │ │ └── sigmund@1.0.0 │ │ ├── home-dir@0.1.2 │ │ ├─┬ node-static@0.7.0 │ │ │ ├── colors@0.6.2 │ │ │ └── mime@1.2.11 │ │ ├─┬ request@2.33.0 │ │ │ ├── aws-sign2@0.5.0 │ │ │ ├── forever-agent@0.5.2 │ │ │ ├─┬ form-data@0.1.4 │ │ │ │ ├── async@0.9.0 │ │ │ │ └─┬ combined-stream@0.0.5 │ │ │ │ └── delayed-stream@0.0.5 │ │ │ ├─┬ hawk@1.0.0 │ │ │ │ ├── boom@0.4.2 │ │ │ │ ├── cryptiles@0.2.2 │ │ │ │ ├── hoek@0.9.1 │ │ │ │ └── sntp@0.2.4 │ │ │ ├─┬ http-signature@0.10.0 │ │ │ │ ├── asn1@0.1.11 │ │ │ │ ├── assert-plus@0.1.2 │ │ │ │ └── ctype@0.5.2 │ │ │ ├── json-stringify-safe@5.0.0 │ │ │ ├── mime@1.2.11 │ │ │ ├── node-uuid@1.4.1 │ │ │ ├── oauth-sign@0.3.0 │ │ │ ├── qs@0.6.6 │ │ │ ├─┬ tough-cookie@0.12.1 │ │ │ │ └── punycode@1.3.0 │ │ │ └── tunnel-agent@0.3.0 │ │ ├─┬ request-progress@0.3.1 │ │ │ └── throttleit@0.0.2 │ │ ├── shelljs@0.2.6 │ │ ├─┬ tar@0.1.19 │ │ │ ├── block-stream@0.0.7 │ │ │ ├─┬ fstream@0.1.28 │ │ │ │ ├── graceful-fs@3.0.2 │ │ │ │ ├── mkdirp@0.3.5 │ │ │ │ └── rimraf@2.2.8 │ │ │ └── inherits@2.0.1 │ │ └─┬ useragent@2.0.8 │ │ └── lru-cache@2.2.4 │ ├─┬ cordova@3.5.0-0.2.4 │ │ ├─┬ cordova-lib@0.21.3 │ │ │ ├── bplist-parser@0.0.5 │ │ │ ├─┬ dep-graph@1.1.0 │ │ │ │ └── underscore@1.2.1 │ │ │ ├─┬ elementtree@0.1.5 │ │ │ │ └── sax@0.3.5 │ │ │ ├─┬ glob@3.2.9 │ │ │ │ ├── inherits@2.0.1 │ │ │ │ └─┬ minimatch@0.2.14 │ │ │ │ ├── lru-cache@2.5.0 │ │ │ │ └── sigmund@1.0.0 │ │ │ ├── mime@1.2.11 │ │ │ ├─┬ npm@1.3.4 │ │ │ │ ├── abbrev@1.0.4 │ │ │ │ ├── ansi@0.1.2 │ │ │ │ ├── archy@0.0.2 │ │ │ │ ├── block-stream@0.0.6 │ │ │ │ ├── child-process-close@0.1.1 │ │ │ │ ├── chmodr@0.1.0 │ │ │ │ ├── chownr@0.0.1 │ │ │ │ ├── cmd-shim@1.1.0 │ │ │ │ ├── editor@0.0.4 │ │ │ │ ├── fstream@0.1.23 │ │ │ │ ├─┬ fstream-npm@0.1.4 │ │ │ │ │ └── fstream-ignore@0.0.6 │ │ │ │ ├─┬ glob@3.2.3 │ │ │ │ │ └── inherits@2.0.0 │ │ │ │ ├── graceful-fs@2.0.0 │ │ │ │ ├── inherits@1.0.0 │ │ │ │ ├── ini@1.1.0 │ │ │ │ ├─┬ init-package-json@0.0.10 │ │ │ │ │ └── promzard@0.2.0 │ │ │ │ ├── lockfile@0.4.0 │ │ │ │ ├── lru-cache@2.3.0 │ │ │ │ ├─┬ minimatch@0.2.12 │ │ │ │ │ └── sigmund@1.0.0 │ │ │ │ ├── mkdirp@0.3.5 │ │ │ │ ├── node-gyp@0.10.6 │ │ │ │ ├── nopt@2.1.1 │ │ │ │ ├─┬ npm-registry-client@0.2.27 │ │ │ │ │ └── couch-login@0.1.17 │ │ │ │ ├── npm-user-validate@0.0.3 │ │ │ │ ├─┬ npmconf@0.1.1 │ │ │ │ │ └─┬ config-chain@1.1.7 │ │ │ │ │ └── proto-list@1.2.2 │ │ │ │ ├── npmlog@0.0.4 │ │ │ │ ├── once@1.1.1 │ │ │ │ ├── opener@1.3.0 │ │ │ │ ├── osenv@0.0.3 │ │ │ │ ├─┬ read@1.0.4 │ │ │ │ │ └── mute-stream@0.0.3 │ │ │ │ ├── read-installed@0.2.2 │ │ │ │ ├─┬ read-package-json@1.1.0 │ │ │ │ │ └─┬ normalize-package-data@0.2.0 │ │ │ │ │ └── github-url-from-git@1.1.1 │ │ │ │ ├─┬ request@2.21.0 │ │ │ │ │ ├── aws-sign@0.3.0 │ │ │ │ │ ├── cookie-jar@0.3.0 │ │ │ │ │ ├── forever-agent@0.5.0 │ │ │ │ │ ├─┬ form-data@0.0.8 │ │ │ │ │ │ ├── async@0.2.9 │ │ │ │ │ │ └─┬ combined-stream@0.0.4 │ │ │ │ │ │ └── delayed-stream@0.0.5 │ │ │ │ │ ├─┬ hawk@0.13.1 │ │ │ │ │ │ ├─┬ boom@0.4.2 │ │ │ │ │ │ │ └── hoek@0.9.1 │ │ │ │ │ │ ├── cryptiles@0.2.1 │ │ │ │ │ │ ├── hoek@0.8.5 │ │ │ │ │ │ └─┬ sntp@0.2.4 │ │ │ │ │ │ └── hoek@0.9.1 │ │ │ │ │ ├─┬ http-signature@0.9.11 │ │ │ │ │ │ ├── asn1@0.1.11 │ │ │ │ │ │ ├── assert-plus@0.1.2 │ │ │ │ │ │ └── ctype@0.5.2 │ │ │ │ │ ├── json-stringify-safe@4.0.0 │ │ │ │ │ ├── mime@1.2.9 │ │ │ │ │ ├── node-uuid@1.4.0 │ │ │ │ │ ├── oauth-sign@0.3.0 │ │ │ │ │ ├── qs@0.6.5 │ │ │ │ │ └── tunnel-agent@0.3.0 │ │ │ │ ├── retry@0.6.0 │ │ │ │ ├── rimraf@2.2.0 │ │ │ │ ├── semver@2.0.8 │ │ │ │ ├── sha@1.0.1 │ │ │ │ ├── slide@1.1.4 │ │ │ │ ├── tar@0.1.17 │ │ │ │ ├── uid-number@0.0.3 │ │ │ │ └── which@1.0.5 │ │ │ ├─┬ npmconf@0.1.16 │ │ │ │ ├─┬ config-chain@1.1.8 │ │ │ │ │ └── proto-list@1.2.2 │ │ │ │ ├── inherits@2.0.1 │ │ │ │ ├── ini@1.1.0 │ │ │ │ ├── mkdirp@0.3.5 │ │ │ │ ├─┬ nopt@2.2.1 │ │ │ │ │ └── abbrev@1.0.5 │ │ │ │ └── once@1.3.0 │ │ │ ├── osenv@0.0.3 │ │ │ ├─┬ plist-with-patches@0.5.1 │ │ │ │ ├── xmlbuilder@0.4.3 │ │ │ │ └── xmldom@0.1.19 │ │ │ ├─┬ rc@0.3.0 │ │ │ │ ├── deep-extend@0.2.8 │ │ │ │ ├── ini@1.1.0 │ │ │ │ └─┬ optimist@0.3.7 │ │ │ │ └── wordwrap@0.0.2 │ │ │ ├─┬ request@2.22.0 │ │ │ │ ├── aws-sign@0.3.0 │ │ │ │ ├── cookie-jar@0.3.0 │ │ │ │ ├── forever-agent@0.5.2 │ │ │ │ ├─┬ form-data@0.0.8 │ │ │ │ │ ├── async@0.2.10 │ │ │ │ │ └─┬ combined-stream@0.0.4 │ │ │ │ │ └── delayed-stream@0.0.5 │ │ │ │ ├─┬ hawk@0.13.1 │ │ │ │ │ ├─┬ boom@0.4.2 │ │ │ │ │ │ └── hoek@0.9.1 │ │ │ │ │ ├── cryptiles@0.2.2 │ │ │ │ │ ├── hoek@0.8.5 │ │ │ │ │ └─┬ sntp@0.2.4 │ │ │ │ │ └── hoek@0.9.1 │ │ │ │ ├─┬ http-signature@0.10.0 │ │ │ │ │ ├── asn1@0.1.11 │ │ │ │ │ ├── assert-plus@0.1.2 │ │ │ │ │ └── ctype@0.5.2 │ │ │ │ ├── json-stringify-safe@4.0.0 │ │ │ │ ├── node-uuid@1.4.1 │ │ │ │ ├── oauth-sign@0.3.0 │ │ │ │ ├── qs@0.6.6 │ │ │ │ └── tunnel-agent@0.3.0 │ │ │ ├── semver@2.0.11 │ │ │ ├─┬ tar@0.1.19 │ │ │ │ ├── block-stream@0.0.7 │ │ │ │ ├─┬ fstream@0.1.25 │ │ │ │ │ ├── graceful-fs@2.0.3 │ │ │ │ │ ├── mkdirp@0.3.5 │ │ │ │ │ └── rimraf@2.2.8 │ │ │ │ └── inherits@2.0.1 │ │ │ └─┬ xcode@0.6.6 │ │ │ ├── node-uuid@1.3.3 │ │ │ └── pegjs@0.6.2 │ │ ├── q@0.9.7 │ │ └── underscore@1.4.4 │ ├─┬ cordova-lib@0.21.4-dev (git://github.com/apache/cordova-lib.git#3623a84eb391f41c5a32ddc67eea89512c4ba654) │ │ ├── bplist-parser@0.0.5 │ │ ├─┬ dep-graph@1.1.0 │ │ │ └── underscore@1.2.1 │ │ ├─┬ elementtree@0.1.5 │ │ │ └── sax@0.3.5 │ │ ├─┬ glob@3.2.11 │ │ │ ├── inherits@2.0.1 │ │ │ └─┬ minimatch@0.3.0 │ │ │ ├── lru-cache@2.5.0 │ │ │ └── sigmund@1.0.0 │ │ ├── mime@1.2.11 │ │ ├─┬ npm@1.3.4 │ │ │ ├── abbrev@1.0.4 │ │ │ ├── ansi@0.1.2 │ │ │ ├── archy@0.0.2 │ │ │ ├── block-stream@0.0.6 │ │ │ ├── child-process-close@0.1.1 │ │ │ ├── chmodr@0.1.0 │ │ │ ├── chownr@0.0.1 │ │ │ ├── cmd-shim@1.1.0 │ │ │ ├── editor@0.0.4 │ │ │ ├── fstream@0.1.23 │ │ │ ├─┬ fstream-npm@0.1.4 │ │ │ │ └── fstream-ignore@0.0.6 │ │ │ ├─┬ glob@3.2.3 │ │ │ │ └── inherits@2.0.0 │ │ │ ├── graceful-fs@2.0.0 │ │ │ ├── inherits@1.0.0 │ │ │ ├── ini@1.1.0 │ │ │ ├─┬ init-package-json@0.0.10 │ │ │ │ └── promzard@0.2.0 │ │ │ ├── lockfile@0.4.0 │ │ │ ├── lru-cache@2.3.0 │ │ │ ├─┬ minimatch@0.2.12 │ │ │ │ └── sigmund@1.0.0 │ │ │ ├── mkdirp@0.3.5 │ │ │ ├── node-gyp@0.10.6 │ │ │ ├── nopt@2.1.1 │ │ │ ├─┬ npm-registry-client@0.2.27 │ │ │ │ └── couch-login@0.1.17 │ │ │ ├── npm-user-validate@0.0.3 │ │ │ ├─┬ npmconf@0.1.1 │ │ │ │ └─┬ config-chain@1.1.7 │ │ │ │ └── proto-list@1.2.2 │ │ │ ├── npmlog@0.0.4 │ │ │ ├── once@1.1.1 │ │ │ ├── opener@1.3.0 │ │ │ ├── osenv@0.0.3 │ │ │ ├─┬ read@1.0.4 │ │ │ │ └── mute-stream@0.0.3 │ │ │ ├── read-installed@0.2.2 │ │ │ ├─┬ read-package-json@1.1.0 │ │ │ │ └─┬ normalize-package-data@0.2.0 │ │ │ │ └── github-url-from-git@1.1.1 │ │ │ ├─┬ request@2.21.0 │ │ │ │ ├── aws-sign@0.3.0 │ │ │ │ ├── cookie-jar@0.3.0 │ │ │ │ ├── forever-agent@0.5.0 │ │ │ │ ├─┬ form-data@0.0.8 │ │ │ │ │ ├── async@0.2.9 │ │ │ │ │ └─┬ combined-stream@0.0.4 │ │ │ │ │ └── delayed-stream@0.0.5 │ │ │ │ ├─┬ hawk@0.13.1 │ │ │ │ │ ├─┬ boom@0.4.2 │ │ │ │ │ │ └── hoek@0.9.1 │ │ │ │ │ ├── cryptiles@0.2.1 │ │ │ │ │ ├── hoek@0.8.5 │ │ │ │ │ └─┬ sntp@0.2.4 │ │ │ │ │ └── hoek@0.9.1 │ │ │ │ ├─┬ http-signature@0.9.11 │ │ │ │ │ ├── asn1@0.1.11 │ │ │ │ │ ├── assert-plus@0.1.2 │ │ │ │ │ └── ctype@0.5.2 │ │ │ │ ├── json-stringify-safe@4.0.0 │ │ │ │ ├── mime@1.2.9 │ │ │ │ ├── node-uuid@1.4.0 │ │ │ │ ├── oauth-sign@0.3.0 │ │ │ │ ├── qs@0.6.5 │ │ │ │ └── tunnel-agent@0.3.0 │ │ │ ├── retry@0.6.0 │ │ │ ├── rimraf@2.2.0 │ │ │ ├── semver@2.0.8 │ │ │ ├── sha@1.0.1 │ │ │ ├── slide@1.1.4 │ │ │ ├── tar@0.1.17 │ │ │ ├── uid-number@0.0.3 │ │ │ └── which@1.0.5 │ │ ├─┬ npmconf@0.1.16 │ │ │ ├─┬ config-chain@1.1.8 │ │ │ │ └── proto-list@1.2.3 │ │ │ ├── inherits@2.0.1 │ │ │ ├── ini@1.1.0 │ │ │ ├── mkdirp@0.3.5 │ │ │ ├─┬ nopt@2.2.1 │ │ │ │ └── abbrev@1.0.5 │ │ │ └── once@1.3.0 │ │ ├── osenv@0.0.3 │ │ ├─┬ plist-with-patches@0.5.1 │ │ │ ├── xmlbuilder@0.4.3 │ │ │ └── xmldom@0.1.19 │ │ ├── properties-parser@0.2.3 │ │ ├── q@0.9.7 │ │ ├─┬ rc@0.3.0 │ │ │ ├── deep-extend@0.2.10 │ │ │ ├── ini@1.1.0 │ │ │ └─┬ optimist@0.3.7 │ │ │ └── wordwrap@0.0.2 │ │ ├─┬ request@2.22.0 │ │ │ ├── aws-sign@0.3.0 │ │ │ ├── cookie-jar@0.3.0 │ │ │ ├── forever-agent@0.5.2 │ │ │ ├─┬ form-data@0.0.8 │ │ │ │ ├── async@0.2.10 │ │ │ │ └─┬ combined-stream@0.0.5 │ │ │ │ └── delayed-stream@0.0.5 │ │ │ ├─┬ hawk@0.13.1 │ │ │ │ ├─┬ boom@0.4.2 │ │ │ │ │ └── hoek@0.9.1 │ │ │ │ ├── cryptiles@0.2.2 │ │ │ │ ├── hoek@0.8.5 │ │ │ │ └─┬ sntp@0.2.4 │ │ │ │ └── hoek@0.9.1 │ │ │ ├─┬ http-signature@0.10.0 │ │ │ │ ├── asn1@0.1.11 │ │ │ │ ├── assert-plus@0.1.2 │ │ │ │ └── ctype@0.5.2 │ │ │ ├── json-stringify-safe@4.0.0 │ │ │ ├── node-uuid@1.4.1 │ │ │ ├── oauth-sign@0.3.0 │ │ │ ├── qs@0.6.6 │ │ │ └── tunnel-agent@0.3.0 │ │ ├── semver@2.0.11 │ │ ├─┬ tar@0.1.20 │ │ │ ├── block-stream@0.0.7 │ │ │ ├─┬ fstream@0.1.28 │ │ │ │ ├── graceful-fs@3.0.2 │ │ │ │ ├── mkdirp@0.3.5 │ │ │ │ └── rimraf@2.2.8 │ │ │ └── inherits@2.0.1 │ │ ├── underscore@1.4.4 │ │ └─┬ xcode@0.6.6 │ │ ├── node-uuid@1.3.3 │ │ └── pegjs@0.6.2 │ ├─┬ optimist@0.6.0 │ │ ├── minimist@0.0.10 │ │ └── wordwrap@0.0.2 │ ├─┬ phonegap-build@0.8.4 │ │ ├─┬ optimist@0.3.7 │ │ │ └── wordwrap@0.0.2 │ │ ├─┬ phonegap-build-api@0.3.3 │ │ │ └─┬ request@2.11.4 │ │ │ ├─┬ form-data@0.0.3 │ │ │ │ ├── async@0.1.9 │ │ │ │ └─┬ combined-stream@0.0.3 │ │ │ │ └── delayed-stream@0.0.5 │ │ │ └── mime@1.2.7 │ │ ├── qrcode-terminal@0.8.0 │ │ └── shelljs@0.0.9 │ ├── pluralize@0.0.4 │ ├─┬ prompt@0.2.11 │ │ ├── pkginfo@0.3.0 │ │ ├─┬ read@1.0.5 │ │ │ └── mute-stream@0.0.4 │ │ ├── revalidator@0.1.8 │ │ ├─┬ utile@0.2.1 │ │ │ ├── async@0.2.10 │ │ │ ├── deep-equal@0.2.1 │ │ │ ├── i@0.3.2 │ │ │ ├─┬ mkdirp@0.5.0 │ │ │ │ └── minimist@0.0.8 │ │ │ ├── ncp@0.4.2 │ │ │ └── rimraf@2.2.8 │ │ └─┬ winston@0.6.2 │ │ ├── async@0.1.22 │ │ ├── cycle@1.0.3 │ │ ├── eyes@0.1.8 │ │ ├── pkginfo@0.2.3 │ │ ├── request@2.9.203 │ │ └── stack-trace@0.0.9 │ ├── qrcode-terminal@0.9.4 │ ├── semver@1.1.0 │ └── shelljs@0.1.4 └─┬ ws@0.4.31 ├── commander@0.6.1 ├── nan@0.3.2 ├── options@0.0.5 └── tinycolor@0.0.1

npm ERR! peer invalid: cylon-gpio@0.15.1 /Users/neo/node_modules/cylon-gpio npm ERR! peer invalid: cylon-i2c@0.12.1 /Users/neo/node_modules/cylon-i2c npm ERR! not ok code 0

stewart commented 10 years ago

Do you have a package.json, or did you install all these modules manually?

neonag commented 10 years ago

i did manual install

neonag commented 10 years ago

not everything but few of them .. but don't remember which

stewart commented 10 years ago

Can you try forcing your cylon modules to update with this command? Then run npm list cylon again and let me know if there's still a peer dependency error.

$ npm install cylon-firmata cylon-gpio cylon-i2c cylon-leapmotion
neonag commented 10 years ago

yup did it and got this

├── cylon@0.17.0 ├─┬ cylon-firmata@0.14.0 │ └── cylon@0.16.0 ├─┬ cylon-gpio@0.17.0 │ └── cylon@0.16.0 ├─┬ cylon-i2c@0.13.0 │ └── cylon@0.16.0 └─┬ cylon-leapmotion@0.11.0 └── cylon@0.16.0

stewart commented 10 years ago

Okay, awesome. Looks like you have the latest versions of everything now.

Can you check if the issue is still present?

neonag commented 10 years ago

surely i will test my code on the Motor Shield and get back in some time

neonag commented 10 years ago

still not working :( the motor sheild doesnt respond i tried a simple code to run a servo motor now so that its easy for testing using the following code :

var Cylon = require('cylon');

Cylon.robot({
  connection: [
    { name: 'arduino', adaptor: 'firmata', port: '/dev/tty.usbmodem621'},
    { name: 'leapmotion', adaptor: 'leapmotion', port: '127.0.0.1:6437' }
  ],
  device: [
    {name: 'servo', driver: 'servo', pin: 3},
  ],

 work: function(my) {
    var angle = 45 ;
    var angle1 = 135; 
    my.servo.angle(angle);

    my.leapmotion.on('hand', function(hand) {
    if(hand.grabStrength == 1){
      my.servo.angle(angle); 
    } else if(hand.grabStrength == 0) {
      my.servo.angle(angle1);

    }
   });
  }
}).start();
edgarsilva commented 10 years ago

@neonag I don't think that's how the motor shield works, the first motor shield the v1 used the pwm pins of the arduino the v2 uses an i2c pwm driver in the shield if I remember correctly.

Try just connecting the servo to the arduino directly, with the same code, and connect the DC plug on the arduino to provide enough juice.

If that works fine, then it is an issue on how to wire up the motor shield. @deadprogram might be able to provide some assistance with that, he has some experience with the motor shield, and I only have the I2C one.

neonag commented 10 years ago

@edgarsilva i have successfully made it work directly connecting to Arduino ... just wanted to use the shield to avoid all bread board and wires ...

deadprogram commented 10 years ago

Hi, there. This is my code I use for the v1 motor shield, controlled by a Spark:

var Cylon = require('cylon');

Cylon.robot({
  connection: {
    name: 'spark', adaptor: 'spark',
    accessToken: '[your access token]',
    deviceId: '[your device id]'
  },

  devices: [
  {name: 'leftMotor', driver: 'motor', pin: "D1"},
  {name: 'rightMotor', driver: 'motor', pin: "A7"},
  {name: 'leftDirection', driver: 'direct-pin', pin: "D3"},
  {name: 'rightDirection', driver: 'direct-pin', pin: "D4"}
  ],

  work: function(my) {
    my.leftDirection.digitalWrite(1);
    my.rightDirection.digitalWrite(1);
    my.leftMotor.speed(100);
    my.rightMotor.speed(100);
    after((10).seconds(), function() {
      my.leftDirection.digitalWrite(0);
      my.rightDirection.digitalWrite(0);
    });
    after((20).seconds(), function() {
      my.leftDirection.digitalWrite(1);
      my.rightDirection.digitalWrite(0);
    });
    after((21).seconds(), function() {
      my.leftDirection.digitalWrite(0);
      my.rightDirection.digitalWrite(1);
    });
    after((22).seconds(), function() {
      my.leftDirection.digitalWrite(1);
      my.rightDirection.digitalWrite(0);
    });
    after((23).seconds(), function() {
      my.leftDirection.digitalWrite(0);
      my.rightDirection.digitalWrite(1);
    });
    after((24).seconds(), function() {
      my.leftMotor.turnOff();
      my.rightMotor.turnOff();
    });
  }
}).start();

The v1 motor shield uses 2 pins per motor that it can control. One PWM for speed, the other for direction.

Hope that helps!

neonag commented 10 years ago

@deadprogram i will try working on this tonight and get back to you Thanks for the code will try it out

neonag commented 10 years ago

hi all you can close the post now i guess the problem with the board itself need to get new sheild and try again

ghost commented 7 years ago

How do I add multiple led's in arduino and write the code sample code: `var Cylon = require("cylon");

// define the robot var robot = Cylon.robot({ // change the port to the correct one for your Arduino connections: { arduino: { adaptor: "firmata", port: "COM4" } },

devices: { led: { driver: "led", pin: 13 } },

work: function(my) { every((3).second(), my.led.toggle); } });

// connect to the Arduino and start working robot.start();`