You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mower.cpp funktion void Mower::setActuator(char type, int value):
Although the drivers L298N and MC33926 can be defined as DRIVER_L298N/DRIVER_MC33926 in mower.h, only the function setMC33926() will be called in above function. Changes have to be done manually, if the L298Ns is used like in my Ardu Mini.
Since there are two different motors with eventually two different drivers in use it might make sense to leave above definitions and define a new one like DRIVER_MOWER_L298N or DRIVER_MOWER_MC33926.
With the above you could call wrapper-functions like that: case ACT_MOTOR_LEFT: // genereller Aufruf der neuen Wrapper-Funktion -> drivers.cpp setMotorDriver(pinMotorLeftDir, pinMotorLeftPWM, value); break;
or setMowerDriver(...) for the mower motor
In driver.cpp: void setMotorDriver(int pinDir,int pinPWM,int value){ #ifdef DRIVER_L298N setL298N(pinDir, pinPWM, value); #else #ifdef DRIVER_MC33926 setMC33926(pinDir, pinPWM, value); #endif #endif }
Other drivers could be easily implemented and nobody would puzzle why the motors change directions by installing a new firmware.
The text was updated successfully, but these errors were encountered:
In mower.cpp funktion void Mower::setActuator(char type, int value):
Although the drivers L298N and MC33926 can be defined as DRIVER_L298N/DRIVER_MC33926 in mower.h, only the function setMC33926() will be called in above function. Changes have to be done manually, if the L298Ns is used like in my Ardu Mini.
Since there are two different motors with eventually two different drivers in use it might make sense to leave above definitions and define a new one like DRIVER_MOWER_L298N or DRIVER_MOWER_MC33926.
With the above you could call wrapper-functions like that:
case ACT_MOTOR_LEFT: // genereller Aufruf der neuen Wrapper-Funktion -> drivers.cpp setMotorDriver(pinMotorLeftDir, pinMotorLeftPWM, value); break;
or setMowerDriver(...) for the mower motor
In driver.cpp:
void setMotorDriver(int pinDir,int pinPWM,int value){ #ifdef DRIVER_L298N setL298N(pinDir, pinPWM, value); #else #ifdef DRIVER_MC33926 setMC33926(pinDir, pinPWM, value); #endif #endif }
Other drivers could be easily implemented and nobody would puzzle why the motors change directions by installing a new firmware.
The text was updated successfully, but these errors were encountered: