Entrega 3er corte - sistemas embebidos

Committer:
Bethory
Date:
Wed May 30 04:46:28 2018 +0000
Revision:
1:fcdb45ee95b9
Parent:
0:6ad07c9019fd
Entrega Final

Who changed what in which revision?

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