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:514839746b7c, committed 2011-07-03
- Comitter:
- yueee_yt
- Date:
- Sun Jul 03 10:39:38 2011 +0000
- Commit message:
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jul 03 10:39:38 2011 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +DigitalOut step_a(p19); +DigitalOut step_b(p20); + +Ticker timer1; + +void add_step(void) { + static int mode=0; + switch (mode) { + case 0 : + step_b=0; + step_a=1; + mode=1; + break; + case 1 : + step_a=1; + step_b=1; + mode=2; + break; + case 2: + step_a=0; + step_b=1; + mode=3; + break; + case 3: + step_a=0; + step_b=0; + mode=0; + break; + } + myled=!myled; +} + +int main() { + timer1.attach(&add_step, 0.01); + + while (1); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jul 03 10:39:38 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912