Motor
Background: PWM and GPIO Usage
Class Description
Todo
Motor
Note that the SysFS_Motor class does not expose how the motor
control works - it shouldn’t. Rather, it has only one method,
set_speed(percentage_of_max_speed).
Depending on the parameter’s value, IOs and PWM are tuned
accordingly. Give examples (here in Sphinx/RST, not in code/doxygen) so the user
can understand how set_speed() is implemented in terms of
SysFS_Motor’s forward, backward and speed ctor
params.
-
class SysFS_Motor
Motor driver on top of GPIO and PWM
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
Public Functions
-
inline SysFS_Motor(SysFS_GPIO_Pin forward, SysFS_GPIO_Pin backward, SysFS_PWM_Pin speed)
Constructor
- Parameters:
forward – blah blah blah blah blah blah
backward – blah blah blah blah blah blah
speed – blah blah blah blah blah blah
-
void set_speed(int percentage_of_max_speed)
Set speed
explain unit of percentage_of_max_speed
- Parameters:
percentage_of_max_speed – blah blah blah blah blah blah
-
inline SysFS_Motor(SysFS_GPIO_Pin forward, SysFS_GPIO_Pin backward, SysFS_PWM_Pin speed)
Future
Todo
Motor
How about pulling the brake? How would that work? What’s the difference between a hard brake and
set_speed(0)?Overcurrent detection? How would one make use of an ADC to implement this?