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.
Motor Class Reference
Class for controlling motors trough PCA9555. More...
#include <motor.h>
Public Member Functions | |
| Motor (PinName PWMpin, PCA9555 *ioExt, unsigned int dir1Pin, unsigned int dir2Pin, PinName encA, PinName encB) | |
| Create an instance of the motor connected to specfied pins, and IO-expander. | |
| void | setSpeed (int newSpeed) |
| Set speed setpoint. | |
| int | getSpeed () |
| Get current speed setpoint value. | |
| void | pid () |
| Method that calculates appropriate PWM values for keeping motor speed close to setpoint This method shoud be called periodically (60Hz) | |
Detailed Description
Class for controlling motors trough PCA9555.
Definition at line 8 of file motor.h.
Constructor & Destructor Documentation
| Motor | ( | PinName | PWMpin, |
| PCA9555 * | ioExt, | ||
| unsigned int | dir1Pin, | ||
| unsigned int | dir2Pin, | ||
| PinName | encA, | ||
| PinName | encB | ||
| ) |
Create an instance of the motor connected to specfied pins, and IO-expander.
- Parameters:
-
PWMpin Pin for PWM output *ioExt Pointer to IO-expander object dir1Pin Direction pin 1 number (on IO-expander) dir2Pin Direction pin 2 number (on IO-expander) encA Encoder pin encB Encoder pin
Member Function Documentation
| void pid | ( | ) |
Generated on Sun Jul 17 2022 05:33:11 by
1.7.2