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@5:5d767f9355e2, 2019-01-24 (annotated)
- Committer:
- CharlesBl
- Date:
- Thu Jan 24 09:40:10 2019 +0000
- Revision:
- 5:5d767f9355e2
- Parent:
- 4:4329f61a927e
- Child:
- 6:e20ec9f212ea
code qui marche
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
CharlesBl | 0:d0a183ba50d5 | 1 | #include "mbed.h" |
CharlesBl | 5:5d767f9355e2 | 2 | #include "defines.h" |
robot_ligne | 4:4329f61a927e | 3 | #include "moteur.h" |
CharlesBl | 0:d0a183ba50d5 | 4 | |
CharlesBl | 5:5d767f9355e2 | 5 | UARTSerial controlleur(D10,D2,115200); |
CharlesBl | 5:5d767f9355e2 | 6 | Serial pc(SERIAL_TX, SERIAL_RX); |
CharlesBl | 0:d0a183ba50d5 | 7 | |
CharlesBl | 3:5c32522fbe3f | 8 | int main(){ |
CharlesBl | 5:5d767f9355e2 | 9 | while(1){ |
CharlesBl | 5:5d767f9355e2 | 10 | for(int i=0; i<15; i++) { |
CharlesBl | 5:5d767f9355e2 | 11 | command(drive_forward_M1 ,i); |
CharlesBl | 5:5d767f9355e2 | 12 | command(drive_forward_M2 ,i); |
CharlesBl | 3:5c32522fbe3f | 13 | wait_ms(100); |
CharlesBl | 3:5c32522fbe3f | 14 | } |
CharlesBl | 5:5d767f9355e2 | 15 | for(int i=15; i>0; i--) { |
CharlesBl | 5:5d767f9355e2 | 16 | command(drive_forward_M1 ,i); |
CharlesBl | 5:5d767f9355e2 | 17 | command(drive_forward_M2 ,i); |
CharlesBl | 3:5c32522fbe3f | 18 | wait_ms(100); |
CharlesBl | 3:5c32522fbe3f | 19 | } |
CharlesBl | 3:5c32522fbe3f | 20 | |
CharlesBl | 5:5d767f9355e2 | 21 | for(int i=0; i<15; i++) { |
CharlesBl | 5:5d767f9355e2 | 22 | command(drive_backwards_M1 ,i); |
CharlesBl | 5:5d767f9355e2 | 23 | command(drive_backwards_M2 ,i); |
CharlesBl | 3:5c32522fbe3f | 24 | wait_ms(100); |
CharlesBl | 3:5c32522fbe3f | 25 | } |
CharlesBl | 5:5d767f9355e2 | 26 | for(int i=15; i>0; i--) { |
CharlesBl | 5:5d767f9355e2 | 27 | command(drive_backwards_M1 ,i); |
CharlesBl | 5:5d767f9355e2 | 28 | command(drive_backwards_M2 ,i); |
CharlesBl | 3:5c32522fbe3f | 29 | wait_ms(100); |
CharlesBl | 3:5c32522fbe3f | 30 | } |
CharlesBl | 0:d0a183ba50d5 | 31 | } |
CharlesBl | 0:d0a183ba50d5 | 32 | } |
CharlesBl | 3:5c32522fbe3f | 33 | |
CharlesBl | 3:5c32522fbe3f | 34 | |
CharlesBl | 3:5c32522fbe3f | 35 |