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.
Dependents: AresCDFMainCode_capteur_US AresCDFMainCode_us2 AresCDFMainCode
main.cpp@0:4bf91783cb4d, 2020-06-12 (annotated)
- Committer:
- g0dd4
- Date:
- Fri Jun 12 17:24:35 2020 +0000
- Revision:
- 0:4bf91783cb4d
Creation library module DRV8825
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| g0dd4 | 0:4bf91783cb4d | 1 | #include "mbed.h" |
| g0dd4 | 0:4bf91783cb4d | 2 | #include "DRV8825.h" |
| g0dd4 | 0:4bf91783cb4d | 3 | |
| g0dd4 | 0:4bf91783cb4d | 4 | |
| g0dd4 | 0:4bf91783cb4d | 5 | #define pinEN PI_3 |
| g0dd4 | 0:4bf91783cb4d | 6 | #define pinDIR PI_0 |
| g0dd4 | 0:4bf91783cb4d | 7 | #define pinSTEP PH_6 |
| g0dd4 | 0:4bf91783cb4d | 8 | |
| g0dd4 | 0:4bf91783cb4d | 9 | int main() { |
| g0dd4 | 0:4bf91783cb4d | 10 | |
| g0dd4 | 0:4bf91783cb4d | 11 | DRV8825 drv8825(pinEN,pinDIR,pinSTEP); |
| g0dd4 | 0:4bf91783cb4d | 12 | while(1){ |
| g0dd4 | 0:4bf91783cb4d | 13 | drv8825.setEnable(START); |
| g0dd4 | 0:4bf91783cb4d | 14 | drv8825.setDir(STOP); |
| g0dd4 | 0:4bf91783cb4d | 15 | drv8825.move(1); |
| g0dd4 | 0:4bf91783cb4d | 16 | } |
| g0dd4 | 0:4bf91783cb4d | 17 | } |