esta librería sirve para el control del motor paso a paso.

Dependents:   PICCOLO_CNC1

Step_Motor.h

Committer:
Stevenor1997
Date:
2018-04-25
Revision:
4:8581e6927b36
Parent:
3:ec3add9f1351

File content as of revision 4:8581e6927b36:

#ifndef STEP_MOTOR_H
#define STEP_MOTOR_H
 
#include "mbed.h"
 
#define NUME_PASOS 45629
#define RADIO_R 50
 
class stepmotor {
public:
 
    stepmotor(PinName in1, PinName in2, PinName in3, PinName in4,PinName in5, PinName in6, PinName in7, PinName in8); 
    void step(uint32_t num_steps,uint8_t cw);
    void set_speed(int speed);
    uint32_t get_speed();
private:
    BusOut motor_out;
    uint32_t motorSpeed; 
    int8_t nstep;
    int8_t nstep2;
    int8_t ms2;
    void move();
};
 
#endif