From 8bd5f2b35c608019e21056bd5bd66527becede53 Mon Sep 17 00:00:00 2001 From: Jakob Bak Date: Fri, 1 Feb 2013 11:33:43 +0100 Subject: [PATCH] Changed default direction for MOTORB Due to hardware design of MM board MOTORA and MOTORB had opposite directions. Fixed by switching settings for MOTORB in MMotor::direction(DIRECTION) function --- software/lib/MMM/Motor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/software/lib/MMM/Motor.cpp b/software/lib/MMM/Motor.cpp index 59c7ac9..5398e0a 100755 --- a/software/lib/MMM/Motor.cpp +++ b/software/lib/MMM/Motor.cpp @@ -102,8 +102,8 @@ void MMotor::direction(DIRECTION d) _d = d; if(_m == MOTORA && _d == FORWARD) PORTD |= (1 << PD7); else if(_m == MOTORA && _d == BACKWARD) PORTD &= ~(1 << PD7); - else if(_m == MOTORB && _d == BACKWARD) PORTB |= (1 << PB0); - else if(_m == MOTORB && _d == FORWARD) PORTB &= ~(1 << PB0); + else if(_m == MOTORB && _d == BACKWARD) PORTB &= ~(1 << PB0); // The direction of FORWARD and BACKWARD is + else if(_m == MOTORB && _d == FORWARD) PORTB |= (1 << PB0); // switched for MOTORB due to hardware design } void MMotor::stop()