Git Product home page Git Product logo

Comments (4)

runger1101001 avatar runger1101001 commented on July 17, 2024

You're right... no one has ever reported this before, I think because it is generally assumed that you either

  • always pass the target value to the move function
  • or never pass the target value via move, and instead just set motor.target

To see the bug you're experiencing you must be passing the value sometimes, and sometimes not. As a workaround, I suggest just using motor.target = x; to change the target, rather than using the move function.

In the next release, I think we'll probably place the target setting at the top of the function like you suggest to solve this edge case.

In a future version of the API, I would remove the parameter to move() completely, as the semantics are confusing, and either just setting the member field directly or using a setter function like motor.setTarget() would be clearer, I feel.

from arduino-foc.

runger1101001 avatar runger1101001 commented on July 17, 2024

Solved for BLDCMotor, StepperMotor and HybridStepperMotor (drivers repository). DCMotor was not affected.

Merged to dev branch.

from arduino-foc.

sylque avatar sylque commented on July 17, 2024

In a future version of the API, I would remove the parameter to move() completely, as the semantics are confusing

Agreed.

from arduino-foc.

askuric avatar askuric commented on July 17, 2024

Thanks for this. This one is an old and sneaky one!

The parameter for move was the initial way to set the target value. We have pivoted from this paradigm some time ago with the motor.target. The parameter to move stayed no to break the API at first. And it stayed a bit too long :D

from arduino-foc.

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.