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
00001 #include "mbed.h" 00002 #include "Stepper.h" 00003 00004 // Pin setup 00005 DigitalOut step(p22); 00006 DigitalOut dir(p21); 00007 DigitalOut m1(p23); 00008 DigitalOut m0(p24); 00009 DigitalOut step_indicator(LED1); 00010 00011 00012 // Microstepping config 00013 // (m1)|(m0)|(mode) 00014 // 0|0|full 00015 // 0|1|1/2 00016 // 0|Z|1/4 00017 // 1|0|8 usteps/sec 00018 // 1|1|16 usteps/sec 00019 // 1|Z|32 usteps/sec 00020 int delay = 10; 00021 00022 int main() 00023 { 00024 m1 = 0; 00025 m0 = 0; 00026 step = 0; 00027 dir = 1; 00028 step_indicator = 0; 00029 00030 while(1) { 00031 for (int i=1; i<=200*16; ++i) { 00032 step = 1; 00033 step_indicator = 1; 00034 wait_ms(delay); 00035 step = 0; 00036 step_indicator = 0; 00037 wait_ms(delay); 00038 } 00039 dir = !dir; 00040 wait(1.0); 00041 } 00042 }
Generated on Thu Jul 14 2022 01:11:01 by
1.7.2