From fe7176483a4174ba94d963023a13fe5075bf79af Mon Sep 17 00:00:00 2001 From: Walt Sorensen Date: Fri, 11 Oct 2019 18:34:41 -0600 Subject: [PATCH] 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 | --- DualVNH5019MotorShieldMod3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DualVNH5019MotorShieldMod3.cpp b/DualVNH5019MotorShieldMod3.cpp index c1193b1..e7ace84 100644 --- a/DualVNH5019MotorShieldMod3.cpp +++ b/DualVNH5019MotorShieldMod3.cpp @@ -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 { @@ -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 {