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
main.cpp@0:a1d256e2cd41, 2015-05-21 (annotated)
- Committer:
- thmaure
- Date:
- Thu May 21 14:21:25 2015 +0000
- Revision:
- 0:a1d256e2cd41
moteur pas ? pas
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thmaure | 0:a1d256e2cd41 | 1 | #include "mbed.h" |
thmaure | 0:a1d256e2cd41 | 2 | |
thmaure | 0:a1d256e2cd41 | 3 | DigitalOut enable(D2); |
thmaure | 0:a1d256e2cd41 | 4 | PwmOut step(D3); |
thmaure | 0:a1d256e2cd41 | 5 | PwmOut led(LED2); |
thmaure | 0:a1d256e2cd41 | 6 | DigitalInOut mybut(USER_BUTTON); |
thmaure | 0:a1d256e2cd41 | 7 | |
thmaure | 0:a1d256e2cd41 | 8 | int main() { |
thmaure | 0:a1d256e2cd41 | 9 | |
thmaure | 0:a1d256e2cd41 | 10 | enable=1; |
thmaure | 0:a1d256e2cd41 | 11 | step.period_ms(10); |
thmaure | 0:a1d256e2cd41 | 12 | step.pulsewidth_ms(5); |
thmaure | 0:a1d256e2cd41 | 13 | while(1){ |
thmaure | 0:a1d256e2cd41 | 14 | |
thmaure | 0:a1d256e2cd41 | 15 | enable=0; |
thmaure | 0:a1d256e2cd41 | 16 | wait(0.1); |
thmaure | 0:a1d256e2cd41 | 17 | enable=1; |
thmaure | 0:a1d256e2cd41 | 18 | wait(0.4); |
thmaure | 0:a1d256e2cd41 | 19 | } |
thmaure | 0:a1d256e2cd41 | 20 | } |