Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MotorDriveBase.h
00001 // Generic interface for "standard" H-Bridge motor driver 00002 00003 class MotorDriveBase 00004 { 00005 virtual void stop() = 0; 00006 virtual void emergencyStop() = 0; 00007 00008 00009 // Set speed -MAX_PWM for max reverse, MAX_PWM for max forward 00010 inline void setSpeed(const float spdReq) 00011 { 00012 setSpeed(spdReq,millis()); 00013 } 00014 00015 // many (all?) drivers may have some mode transition times and pauses. 00016 // use these to indicate current time, to avoid repeated calls to millis() 00017 virtual void setSpeed(const float spd, const int t) = 0; // pass in current time 00018 virtual void update(int t) = 0; // check if some sort of state change needs to be processed 00019 };
Generated on Sat Jul 23 2022 07:33:03 by
