Git Product home page Git Product logo

Comments (11)

jcane86 avatar jcane86 commented on June 15, 2024 1

Hiya,

I was just going through the config, as I don't actually have an official adafruit MotorHAT to test this on, but it seems my (clone) board has a different i2c address than the default adafruit one.

Could you change that line for:

var motorHat = require('motor-hat')({
  address: 0x60,
  steppers: [
    ['M1', 'M2'],
    ['M3', 'M4']
  ]
});

and see if it makes any difference?

Alternatively, check in Adafruit's python code, in the file Adafruit_MotorHAT_Motors.py, around line 227 you should have a line similar to this:

class Adafruit_MotorHAT:
    [...]
    def __init__(self, addr = 0x60, freq = 1600, i2c=None, i2c_bus=None):

If that address (addr) is not 0x6F (default in my library) change it to whatever's in there (0x60 in this case).

Hope that helps.

Cheers

from motor-hat.

richiepreece avatar richiepreece commented on June 15, 2024

I'm trying to do some development to prepare for a motor hat arriving on Tuesday. Could a lack of motor hat be the issue? Since there's technically no i2c device installed?

from motor-hat.

jcane86 avatar jcane86 commented on June 15, 2024

Hey there,

sorry for the delay, I recently moved house and just got all my setup back in place to test with the rpi. Did you manage to get it working with the actual MotorHAT?
It does sound like it could be a problem with the board not beeing there, but I haven't been able to reproduce it yet.

from motor-hat.

richiepreece avatar richiepreece commented on June 15, 2024

I wasn't able to get it working. When using Adafruit's example python code, I could get the hat to run, but when using this library, I still had the error thrown. The breaking code looks like:

var motorHat = require('motor-hat')({
  steppers: [
    ['M1', 'M2'],
    ['M3', 'M4']
  ]
});

from motor-hat.

richiepreece avatar richiepreece commented on June 15, 2024

Ok. I'll give it a go. Seeing address 0x60 seems to ring a bell, so I'll let you know if that helps. Thanks again!

from motor-hat.

jcane86 avatar jcane86 commented on June 15, 2024

Hi @richiepreece ,

any luck with this? should I close the issue?

from motor-hat.

richiepreece avatar richiepreece commented on June 15, 2024

Hey, my brother in law has the hat, so I've been unable to test. Sorry! Feel free to close the issue

from motor-hat.

liabru avatar liabru commented on June 15, 2024

Setting the address solved this issue for me. Maybe it should be default?
Thank you for your work on this!

from motor-hat.

GitStevie avatar GitStevie commented on June 15, 2024

Just wanted to say I had the exact same problem above. I came here to whine about it and saw the post above with the identical issue.
Based on that I tried the "address: 0x60", which I hadn't seen in the documentation and poof - it worked! Coolio! Thanks! I have two Adafruit stepper hats and default i2c addresses it uses are 0x60 and 0x70. Thanks again!

from motor-hat.

violuke avatar violuke commented on June 15, 2024

@jcane86 Thanks for the handy lib. I can see that this is referenced in the readme, but it would have been really handy for me to have known that the "non-default" was the "default" for the official hat. Could that be added to the readme for others? I wasted a lot of time on this step. Thanks.

from motor-hat.

jcane86 avatar jcane86 commented on June 15, 2024

@violuke Yeah, point taken. I started this for myself, and I don't have an official hat, so it kinda grew from there.

Do you think there's a better way to default this? I'm a bit hesitant to just make the official one default, as it would break it for anyone using the default. Maybe that's not a lot of people anyway.

Otherwise, feel free to open a PR with some more clarification to the readme, that would be much appreciated.

Thanks for your feedback!

from motor-hat.

Related Issues (20)

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.