dasf

Dependencies:   mbed a4988

Fork of Ex_Stepper by YX ZHANG

main.cpp

Committer:
glintligo
Date:
2018-07-17
Revision:
6:f86c43194362
Parent:
5:4219a5c6afc1

File content as of revision 6:f86c43194362:

#include "mbed.h"
#include "a4988.h"

//             en   step  dir
Stepper moter(PC_13, PB_0, PB_1); //实例化一个步进电机对象
int main()
{

    moter.enable();            //启动步进电机
    moter.step(1, 5000, 3200); // 1表示正转0表示反转 5000hz脉冲周期 转3200个脉冲
    wait(5);                   //等待5s
    moter.disable();           //关闭步进电机电机
    while (1)
    {
    }
}