pausa

Dependencies:   mbed

Fork of primercorte by edson antonio vargas villarreal

Committer:
ANTONIO_VARGAS
Date:
Wed Apr 11 02:19:13 2018 +0000
Revision:
0:0119b611fc51
nnhjk

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ANTONIO_VARGAS 0:0119b611fc51 1
ANTONIO_VARGAS 0:0119b611fc51 2
ANTONIO_VARGAS 0:0119b611fc51 3 #ifndef STEP_MOTOR_H
ANTONIO_VARGAS 0:0119b611fc51 4 #define STEP_MOTOR_H
ANTONIO_VARGAS 0:0119b611fc51 5
ANTONIO_VARGAS 0:0119b611fc51 6 #include "mbed.h"
ANTONIO_VARGAS 0:0119b611fc51 7
ANTONIO_VARGAS 0:0119b611fc51 8 class stepmotor {
ANTONIO_VARGAS 0:0119b611fc51 9 public:
ANTONIO_VARGAS 0:0119b611fc51 10
ANTONIO_VARGAS 0:0119b611fc51 11 stepmotor(PinName in1, PinName in2, PinName in3, PinName in4);
ANTONIO_VARGAS 0:0119b611fc51 12 void step(uint32_t num_steps,bool cw);
ANTONIO_VARGAS 0:0119b611fc51 13 void set_speed(int speed);
ANTONIO_VARGAS 0:0119b611fc51 14 uint32_t get_speed();
ANTONIO_VARGAS 0:0119b611fc51 15 private:
ANTONIO_VARGAS 0:0119b611fc51 16 BusOut motor_out;
ANTONIO_VARGAS 0:0119b611fc51 17 uint32_t motorSpeed;
ANTONIO_VARGAS 0:0119b611fc51 18 int8_t nstep;
ANTONIO_VARGAS 0:0119b611fc51 19
ANTONIO_VARGAS 0:0119b611fc51 20 void move();
ANTONIO_VARGAS 0:0119b611fc51 21 };
ANTONIO_VARGAS 0:0119b611fc51 22
ANTONIO_VARGAS 0:0119b611fc51 23 #endif