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.
main.cpp
- Committer:
- yueee_yt
- Date:
- 2011-07-03
- Revision:
- 0:514839746b7c
File content as of revision 0:514839746b7c:
#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); }