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: TPixy-Interface
Fork of PlayBack by
Drivers/motor_driver.h@0:a355e511bc5d, 2018-02-01 (annotated)
- Committer:
- asobhy
- Date:
- Thu Feb 01 03:58:00 2018 +0000
- Revision:
- 0:a355e511bc5d
- Child:
- 1:3e9684e81312
before testing the QEI
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| asobhy | 0:a355e511bc5d | 1 | |
| asobhy | 0:a355e511bc5d | 2 | #ifndef MOTOR_DRIVER_H |
| asobhy | 0:a355e511bc5d | 3 | #define MOTOR_DRIVER_H |
| asobhy | 0:a355e511bc5d | 4 | |
| asobhy | 0:a355e511bc5d | 5 | //motor configuration |
| asobhy | 0:a355e511bc5d | 6 | #define PERIOD 20000 // period in ms -> frequency = 50kHz -- audible frequency is between 20Hz - 20kHz |
| asobhy | 0:a355e511bc5d | 7 | |
| asobhy | 0:a355e511bc5d | 8 | typedef enum { MOTOR_UNINIT, |
| asobhy | 0:a355e511bc5d | 9 | MOTOR_INIT, |
| asobhy | 0:a355e511bc5d | 10 | MOTOR_FORWARD, |
| asobhy | 0:a355e511bc5d | 11 | MOTOR_REVERSE, |
| asobhy | 0:a355e511bc5d | 12 | MOTOR_STOPPED |
| asobhy | 0:a355e511bc5d | 13 | } motor_state_t; |
| asobhy | 0:a355e511bc5d | 14 | |
| asobhy | 0:a355e511bc5d | 15 | motor_state_t motorDriver_init(); |
| asobhy | 0:a355e511bc5d | 16 | motor_state_t motorDriver_forward(int); |
| asobhy | 0:a355e511bc5d | 17 | motor_state_t motorDriver_reverse(int); |
| asobhy | 0:a355e511bc5d | 18 | motor_state_t motorDriver_stop(); |
| asobhy | 0:a355e511bc5d | 19 | |
| asobhy | 0:a355e511bc5d | 20 | #endif |
