Giro en su propio eje Presentado por: Julio Fajardo, Cesar Pacheco, Angel Trujillo, Daniel Vizcaya
Fork of 01_Embebidos by
stepmotor.h@6:87a37f4163bd, 2018-04-25 (annotated)
- Committer:
- Bethory
- Date:
- Wed Apr 25 02:12:19 2018 +0000
- Revision:
- 6:87a37f4163bd
Ejercicio 2do corte
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Bethory | 6:87a37f4163bd | 1 | |
Bethory | 6:87a37f4163bd | 2 | /****************************************************************************** |
Bethory | 6:87a37f4163bd | 3 | Desarrollado por ferney beltran fbeltran@ecci.edu.co |
Bethory | 6:87a37f4163bd | 4 | |
Bethory | 6:87a37f4163bd | 5 | libreria ejemplo para el motor paso a paso unipolar de 4 fases |
Bethory | 6:87a37f4163bd | 6 | |
Bethory | 6:87a37f4163bd | 7 | ******************************************************************************/ |
Bethory | 6:87a37f4163bd | 8 | |
Bethory | 6:87a37f4163bd | 9 | //***************************************************************************** |
Bethory | 6:87a37f4163bd | 10 | |
Bethory | 6:87a37f4163bd | 11 | #ifndef STEP_MOTOR_H |
Bethory | 6:87a37f4163bd | 12 | #define STEP_MOTOR_H |
Bethory | 6:87a37f4163bd | 13 | |
Bethory | 6:87a37f4163bd | 14 | #include "mbed.h" |
Bethory | 6:87a37f4163bd | 15 | |
Bethory | 6:87a37f4163bd | 16 | class stepmotor { |
Bethory | 6:87a37f4163bd | 17 | public: |
Bethory | 6:87a37f4163bd | 18 | |
Bethory | 6:87a37f4163bd | 19 | stepmotor(PinName in1, PinName in2, PinName in3, PinName in4); |
Bethory | 6:87a37f4163bd | 20 | void step(uint32_t num_steps,bool cw); |
Bethory | 6:87a37f4163bd | 21 | void set_speed(int speed); |
Bethory | 6:87a37f4163bd | 22 | uint32_t get_speed(); |
Bethory | 6:87a37f4163bd | 23 | private: |
Bethory | 6:87a37f4163bd | 24 | BusOut motor_out; |
Bethory | 6:87a37f4163bd | 25 | uint32_t motorSpeed; |
Bethory | 6:87a37f4163bd | 26 | int8_t nstep; |
Bethory | 6:87a37f4163bd | 27 | |
Bethory | 6:87a37f4163bd | 28 | void move(); |
Bethory | 6:87a37f4163bd | 29 | }; |
Bethory | 6:87a37f4163bd | 30 | |
Bethory | 6:87a37f4163bd | 31 | #endif |