![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dfd
Fork of whouse by
Diff: main.cpp
- Revision:
- 2:ecf401a37aa3
- Parent:
- 0:2e00b81c9137
- Child:
- 3:09f6061e6e5d
diff -r 6bf8f2422228 -r ecf401a37aa3 main.cpp --- a/main.cpp Fri May 11 06:55:13 2018 +0000 +++ b/main.cpp Fri May 11 10:25:12 2018 +0000 @@ -3,12 +3,36 @@ #include "robo.h" Serial Info(PB_10,PB_11); Ticker t1; -Stepper_motor s1(PB_9,PB_0,PB_7,PA_11,10,16,1); +/*Stepper_motor s1(PB_9,PB_0,PB_7,PA_11,10,16,1); Stepper_motor s2(PB_6,PA_7,PB_4,PA_15,10,16,1); Stepper_motor s3(PB_3,PA_6,PA_12,PB_1,10,16,1); +*/ +// en step dir button 减速比 细分数 初始方向 +Stepper_motor s1(PA_6,PC_5,PC_4,PB_14,10,16,0);//x +Stepper_motor s2(PA_2,PA_5,PA_4,PC_6,10,16,1);//y +Stepper_motor s3(PC_13,PC_3,PC_2,PB_15,10,16,0);//z +PwmOut pwm2(PA_1); +DigitalOut button(PA_0); + int main() { - s1.Init(); + pwm2.period_ms(1); + pwm2.pulsewidth_us(500); + /*s1.Init(); + wait(5); s2.Init(); + wait(5); s3.Init();//电机初始化 + wait(5); + s3.Config(5,-90); + */ + while(1) + { + + button = 0; + wait(5); + button = 1; + //pwm2.pulsewidth_us(1000); + wait(5); + } }