Skip to content

Commit

Permalink
Motor 4 functions should use OCR5A, not OCR5B
Browse files Browse the repository at this point in the history
Pins Reference [see link](http://astro.neutral.org/arduino/arduino-pwm-pins-frequency.shtml)
Addresses issue #6
| Arduino Pin | Register |
|-------------|----------|
| 2           | OCR3B    |
| 3           | OCR3C    |
| 4           | OCR4C    |
| 5           | OCR3A    |
| 6           | OCR4A    |
| 7           | OCR4B    |
| 8           | OCR4C    |
| 9           | OCR2B    |
| 10          | OCR2A    |
| 11          | OCR1A    |
| 12          | OCR1B    |
| 13          | OCR0A    |
| 44          | OCR5C    |
| 45          | OCR5B    |
| 46          | OCR5A    |
  • Loading branch information
photodude authored Oct 12, 2019
1 parent 227a49b commit fe71764
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DualVNH5019MotorShieldMod3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ void DualVNH5019MotorShieldMod3::setM4Speed(int speed)
#ifdef DUALVNH5019MOTORSHIELD_TIMER5_AVAILABLE
if (_PWM3 == _PWM3_TIMER5_PIN && _PWM4 == _PWM4_TIMER5_PIN)
{
OCR5B = speed;
OCR5A = speed;
}
else
{
Expand Down Expand Up @@ -592,7 +592,7 @@ void DualVNH5019MotorShieldMod3::setM4Brake(int brake)
#ifdef DUALVNH5019MOTORSHIELD_TIMER5_AVAILABLE
if (_PWM3 == _PWM3_TIMER5_PIN && _PWM4 == _PWM4_TIMER5_PIN)
{
OCR5B = brake;
OCR5A = brake;
}
else
{
Expand Down

0 comments on commit fe71764

Please sign in to comment.