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.
Dependencies: mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo
Fork of Orion_newPCB_test by
01_DriveTrain/motorDriver.h@11:49344285c82a, 2016-04-24 (annotated)
- Committer:
- akashvibhute
- Date:
- Sun Apr 24 23:54:50 2016 +0000
- Revision:
- 11:49344285c82a
- Child:
- 23:6806c3bacf58
Purepursuit + pid pitch control works nicely; this is the demo setup for the french contigent - 25/Apr/2016
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| akashvibhute | 11:49344285c82a | 1 | #ifndef motorDriver_H |
| akashvibhute | 11:49344285c82a | 2 | #define motorDriver_H |
| akashvibhute | 11:49344285c82a | 3 | |
| akashvibhute | 11:49344285c82a | 4 | #include "generalFunctions.h" |
| akashvibhute | 11:49344285c82a | 5 | #include "mbed.h" |
| akashvibhute | 11:49344285c82a | 6 | #include "virgo3_pinmapping.h" |
| akashvibhute | 11:49344285c82a | 7 | #include "config.h" |
| akashvibhute | 11:49344285c82a | 8 | |
| akashvibhute | 11:49344285c82a | 9 | class motorDriver |
| akashvibhute | 11:49344285c82a | 10 | { |
| akashvibhute | 11:49344285c82a | 11 | public: |
| akashvibhute | 11:49344285c82a | 12 | //motorDriver(PinName mPlus, PinName mMinus, int freq_khz); |
| akashvibhute | 11:49344285c82a | 13 | //void setPWM(float val); |
| akashvibhute | 11:49344285c82a | 14 | |
| akashvibhute | 11:49344285c82a | 15 | motorDriver(); |
| akashvibhute | 11:49344285c82a | 16 | void setPWM_L(float val); |
| akashvibhute | 11:49344285c82a | 17 | void setPWM_R(float val); |
| akashvibhute | 11:49344285c82a | 18 | |
| akashvibhute | 11:49344285c82a | 19 | private: |
| akashvibhute | 11:49344285c82a | 20 | /*PwmOut motor_P; |
| akashvibhute | 11:49344285c82a | 21 | PwmOut motor_M;*/ |
| akashvibhute | 11:49344285c82a | 22 | PwmOut motorL_P; |
| akashvibhute | 11:49344285c82a | 23 | PwmOut motorL_M; |
| akashvibhute | 11:49344285c82a | 24 | PwmOut motorR_P; |
| akashvibhute | 11:49344285c82a | 25 | PwmOut motorR_M; |
| akashvibhute | 11:49344285c82a | 26 | |
| akashvibhute | 11:49344285c82a | 27 | static const float maxPWM = 100.0; |
| akashvibhute | 11:49344285c82a | 28 | static const float minPWM = -100.0; |
| akashvibhute | 11:49344285c82a | 29 | }; |
| akashvibhute | 11:49344285c82a | 30 | |
| akashvibhute | 11:49344285c82a | 31 | |
| akashvibhute | 11:49344285c82a | 32 | #endif |
