dfd

Dependencies:   stepper mbed

Fork of puma_test by Keegan Hu

main.cpp

Committer:
glintligo
Date:
2018-05-11
Revision:
2:ecf401a37aa3
Parent:
0:2e00b81c9137
Child:
3:09f6061e6e5d

File content as of revision 2:ecf401a37aa3:

#include "mbed.h"
#include "Stepper_motor.h"
#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 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()
{
    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);
        }
}