Giter VIP home page Giter VIP logo

dualvnh5019motorshieldmod3's People

Contributors

davidegrayson avatar kevin-pololu avatar per1234 avatar photodude avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dualvnh5019motorshieldmod3's Issues

mismatch for m4Brake and if evaluation

Noticed a typo

The evaluation on the Timer5 pins for the M4brake function evals PWMpin3 instead of PWMpin4

`void DualVNH5019MotorShieldMod3::setM4Brake(int brake)
{
// Normalize brake
if (brake < 0)
{
brake = -brake;
}

if (brake > 400) // Max brake
{
brake = 400;
}

digitalWrite(_INA4, LOW);
digitalWrite(_INB4, LOW);

#ifdef DUALVNH5019MOTORSHIELD_TIMER5_AVAILABLE
if (_PWM3 == _PWM3_TIMER5_PIN && _PWM3 == _PWM3_TIMER5_PIN)`

Consider making pololu/dual-vnh5019-motor-shield a dependency

We should consider making pololu/dual-vnh5019-motor-shield a dependency, and this library as a shim (I think that's the right term) for the additional functions

This would rewrite the library

namespace pololu/dual-vnh5019-motor-shield = DualVNH5019MotorShieldMod1;
namespace pololu/dual-vnh5019-motor-shield = DualVNH5019MotorShieldMod2;

core library functions would be parent functions that we pass two sets of parameters to...

There are pros and cons to consider in making this change

Motor 4 functions should use OCR5A, not OCR5B

The setM4Speed() and setM4Brake functions are currently trying to use OCR5B, which is the same one motor 3 is trying to use.
If motor 4 is on Pin 46, then the motor 4 functions should be using OCR5A.

Default values analog 9

In your library code you reference _CS4 = 9; //analog 9 pin should that read _CS4 = A9; //analog 9 pin

Timer references in comments

Just trying to understand the code a bit more and looks like you have PWM1 and PWM2 pins listed as default 9, 10 in DualVNH5019MotorShieldMod3.cpp but later reference them to Timer 1 in comments and README however aren't they associated with Timer 2 for the Mega?

Also, wondering if I can use pins 44, and 45 by declaring those pins for PWM3 and PWM4 when constructing the object without issue as they are on the same timer. Or would I have to edit other parts? The reason is I am using the sensor shield (v2) and 44 and 45 make for easier cabling as opposed to 45 and 46

Thanks for the library

On the Arduino Mega we have 6 timers and 15 PWM outputs:

Pins 4 and 13: controlled by Timer0
Pins 11 and 12: controlled by Timer1
Pins 9 and10: controlled by Timer2
Pin 2, 3 and 5: controlled by timer 3
Pin 6, 7 and 8: controlled by timer 4
Pin 46, 45 and 44:: controlled by timer 5

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.