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.
Revision 0:701ca418bae4, committed 2018-05-15
- Comitter:
- NicoK3
- Date:
- Tue May 15 09:04:07 2018 +0000
- Commit message:
- work;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 701ca418bae4 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 15 09:04:07 2018 +0000 @@ -0,0 +1,61 @@ +#include "mbed.h" + +DigitalOut IN1(D8); +DigitalOut IN2(D9); +PwmOut ENA(D3); + +DigitalOut IN3(D6); +DigitalOut IN4(D7); +PwmOut ENB(D5); + +void Init(); +void Sortir(); +void Entrer(); +void Stop(); + +int main() +{ + Init(); + + Sortir(); + wait(2); + Entrer(); + wait(2); + + ENB = 1; + IN3 = 0; + IN4 = 1; +} + +void Init() +{ + wait_ms(500); + IN1 = 0; + IN2 = 0; + IN3 = 0; + IN4 = 0; +} + +void Sortir() +{ + ENA = 0.2; + IN1 = 1; + IN2 = 0; + wait(2.5); + Stop(); +} + +void Entrer() +{ + ENA = 0.2; + IN1 = 0; + IN2 = 1; + wait(1.7); + Stop(); +} + +void Stop() +{ + IN1 = 0; + IN2 = 0; +} \ No newline at end of file
diff -r 000000000000 -r 701ca418bae4 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue May 15 09:04:07 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file