MC33296 on version 0.93 software

Dear All,
I'm using the old PCB with MC33296 for motor wheel..I noticed that in the software was something missing to use MC33296...I would like to add the following software part. Could any programmer tell me if it seams ok?..I didn't try yet...DO I need something else in the software? :silly: Thanks


modification in config.h:




Code:
#define pinMotorEnable  30         // EN motors enable



//add these two lines

Code:
// motors
  pinMode(pinMotorEnable, OUTPUT); 
  digitalWrite(pinMotorEnable, HIGH);


modification in driver.cpp to use mC33296 (it was missing)

Code:
// MC33926 motor driver  //--->QUI 5/01/2015
// Check [URL]http://forum.pololu.com/viewtopic.php?f=15&t=5272#p25031[/URL] for explanations.
//(8-bit PWM=255, 10-bit PWM=1023)
// IN1 PinPWM         IN2 PinDir

// PWM                L     Forward
// nPWM               H     Reverse
void setMC33926(int pinDir, int pinPWM, int speed){
  if (speed < 0){
    digitalWrite(pinDir, HIGH) ;
    analogWrite(pinPWM, 255-((byte)abs(speed)));
  } else {
    digitalWrite(pinDir, LOW) ;
    analogWrite(pinPWM, ((byte)speed));
  }
}


modification in driver.h to use mC33296 (it was missing)

Code:
void setMC33926(int pinDir, int pinPWM, int speed);
 
Oben