Skip to content

Commit fe71764

Browse files
authored
Motor 4 functions should use OCR5A, not OCR5B
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 |
1 parent 227a49b commit fe71764

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

DualVNH5019MotorShieldMod3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ void DualVNH5019MotorShieldMod3::setM4Speed(int speed)
440440
#ifdef DUALVNH5019MOTORSHIELD_TIMER5_AVAILABLE
441441
if (_PWM3 == _PWM3_TIMER5_PIN && _PWM4 == _PWM4_TIMER5_PIN)
442442
{
443-
OCR5B = speed;
443+
OCR5A = speed;
444444
}
445445
else
446446
{
@@ -592,7 +592,7 @@ void DualVNH5019MotorShieldMod3::setM4Brake(int brake)
592592
#ifdef DUALVNH5019MOTORSHIELD_TIMER5_AVAILABLE
593593
if (_PWM3 == _PWM3_TIMER5_PIN && _PWM4 == _PWM4_TIMER5_PIN)
594594
{
595-
OCR5B = brake;
595+
OCR5A = brake;
596596
}
597597
else
598598
{

0 commit comments

Comments
 (0)