Comments (7)
Hi @nrbrt looks like you got a new raspberry that my other lib didn't cover yet. If you uninstall motor-hat and reinstall it again, it should hopefully work now.
Sorry for the hassle, and thanks for reporting!
from motor-hat.
Not a problem! The support is awesome ;-)
from motor-hat.
ok, that works now. Thanks a lot! However, I have run into the next hurdle:
/home/pi/node-projects/motor/node_modules/i2c-bus/i2c-bus.js:423
i2c.writeByteSync(peripheralSync(this, addr), cmd, byte);
^
Error: , Remote I/O error
at Bus.writeByteSync (/home/pi/node-projects/motor/node_modules/i2c-bus/i2c-bus.js:423:9)
at setAllPWMSync (/home/pi/node-projects/motor/node_modules/motor-hat/dist/pwm.js:203:9)
at Object.init (/home/pi/node-projects/motor/node_modules/motor-hat/dist/pwm.js:244:7)
at Object.init (/home/pi/node-projects/motor/node_modules/motor-hat/dist/index.js:219:11)
at Object.<anonymous> (/home/pi/node-projects/motor/index.js:1:75)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
errno: 121,
code: '',
syscall: 'writeByteSync'
}
That happens when I try to run your example code:
var motorHat = require('motor-hat')({steppers: [{ W1: 'M1', W2: 'M2' }]}).init();
motorHat.steppers[0].setSpeed({pps:100});
motorHat.steppers[0].step('back', 2048, (err, result) => {
if (err) return console.log('Oh no, there was an error', err);
console.log(`Did ${result.steps} steps ${result.dir} in ${result.duration/1000} seconds. I had to retry ${result.retried} steps because you set me up quicker than your poor board can handle.`);
});
Any ideas?
from motor-hat.
hi @nrbt, yeah, that looks like a common issue with the i2c address being different from the default.
see here #18.
I suggest trying to set the i2c to 0x60,that seems to be a common one
from motor-hat.
@nrbrt basically add the following to the example:
var motorHat = require('motor-hat')({
+ address: 0x60,
steppers: [
['M1', 'M2'],
['M3', 'M4']
]
});
from motor-hat.
BTW, PRs to improve the readme to make this clearer are welcome
from motor-hat.
Wow, I completely missed that one. I think the address selection should be taken out of the "advanced usage" section. My idea was to learn how to walk before doing any running, so I ignored the advanced usage section for the moment and missed that crucial part. I will have a look and see how I can help and contribute to your project. Thanks again!
from motor-hat.
Related Issues (20)
- An in-range update of eslint is breaking the build 🚨 HOT 1
- Issue: We dont recognize your revision
- An in-range update of semantic-release is breaking the build 🚨 HOT 1
- Installation failing on Raspberry Pi 4, node 13.9.0, npm 6.13.7 HOT 19
- Installation failing on Raspberry Pi 4, node v12.16.1, npm 6.13.4 HOT 5
- Revision ID not recognized: new issue for Raspberry Pi 4 HOT 1
- An in-range update of semantic-release is breaking the build 🚨 HOT 4
- An in-range update of sinon is breaking the build 🚨 HOT 4
- An in-range update of semantic-release is breaking the build 🚨 HOT 2
- An in-range update of semantic-release is breaking the build 🚨 HOT 4
- An in-range update of semantic-release is breaking the build 🚨 HOT 2
- An in-range update of semantic-release is breaking the build 🚨 HOT 2
- An in-range update of isparta is breaking the build 🚨 HOT 2
- An in-range update of semantic-release is breaking the build 🚨 HOT 10
- The automated release is failing 🚨 HOT 2
- An in-range update of semantic-release is breaking the build 🚨 HOT 2
- An in-range update of semantic-release is breaking the build 🚨 HOT 2
- busnum is not passed to pwmlib HOT 3
- An in-range update of semantic-release is breaking the build 🚨 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motor-hat.