Acercamiento a lo que pide el profe

Dependencies:   mbed

Fork of 01-01EjercicioFuncionXY by ferney alberto beltran molina

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stepmotor.h Source File

stepmotor.h

00001 
00002 /******************************************************************************
00003         Desarrollado por ferney beltran fbeltran@ecci.edu.co
00004 
00005 libreria  ejemplo para el motor paso a paso unipolar de 4 fases
00006 
00007 ******************************************************************************/
00008 
00009 //*****************************************************************************
00010 
00011 #ifndef STEP_MOTOR_H
00012 #define STEP_MOTOR_H
00013  
00014 #include "mbed.h"
00015  
00016 class stepmotor {
00017 public:
00018  
00019     stepmotor(PinName in1, PinName in2, PinName in3, PinName in4); 
00020     void step(uint32_t num_steps,bool cw);
00021     void set_speed(int speed);
00022     uint32_t get_speed();
00023 private:
00024     BusOut motor_out;
00025     uint32_t motorSpeed; 
00026     int8_t nstep;
00027     
00028     void move();
00029 };
00030  
00031 #endif