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:275d07453b34, 2020-10-04 (annotated)
- Committer:
- rattokiller
- Date:
- Sun Oct 04 15:43:05 2020 +0000
- Revision:
- 0:275d07453b34
test motorino nema;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rattokiller | 0:275d07453b34 | 1 | #include "mbed.h" |
| rattokiller | 0:275d07453b34 | 2 | |
| rattokiller | 0:275d07453b34 | 3 | |
| rattokiller | 0:275d07453b34 | 4 | DigitalOut led(LED1); |
| rattokiller | 0:275d07453b34 | 5 | |
| rattokiller | 0:275d07453b34 | 6 | DigitalOut step(D3); |
| rattokiller | 0:275d07453b34 | 7 | DigitalOut enable(D4); |
| rattokiller | 0:275d07453b34 | 8 | DigitalOut direction(D5); |
| rattokiller | 0:275d07453b34 | 9 | |
| rattokiller | 0:275d07453b34 | 10 | |
| rattokiller | 0:275d07453b34 | 11 | int main() |
| rattokiller | 0:275d07453b34 | 12 | { |
| rattokiller | 0:275d07453b34 | 13 | printf("\nProgramma test stepmotor\n"); |
| rattokiller | 0:275d07453b34 | 14 | enable = 1; |
| rattokiller | 0:275d07453b34 | 15 | wait_ms(500); |
| rattokiller | 0:275d07453b34 | 16 | while(1) { |
| rattokiller | 0:275d07453b34 | 17 | for(int i=0;i<400i++){ |
| rattokiller | 0:275d07453b34 | 18 | step = !step; |
| rattokiller | 0:275d07453b34 | 19 | wait_ms(50); |
| rattokiller | 0:275d07453b34 | 20 | } |
| rattokiller | 0:275d07453b34 | 21 | printf("\nGiro completato\n"); |
| rattokiller | 0:275d07453b34 | 22 | led = !led; |
| rattokiller | 0:275d07453b34 | 23 | wait(1.0); |
| rattokiller | 0:275d07453b34 | 24 | } |
| rattokiller | 0:275d07453b34 | 25 | } |