Library for 4 Phase Step Motor like 28BYJ-48

Dependents:   Stepper_4 LV9_GRUPA2_TIM008_ZADATAK2 LV9_PAI_Grupa2_Tim003-Zadatak1 LV9_PAI_Grupa2-Tim003 ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sMotor.h Source File

sMotor.h

00001 /*
00002 ############################################
00003 ##           sMotor v0.1 Library          ##
00004 ##          created by Samuel Matildes    ##
00005 ############################################
00006         ---- sam.naeec@gmail.com -----
00007 This library was made for 4-Phase Stepper Motors
00008 I don't take any resposability for the damage caused to your equipment.
00009 
00010 */
00011 #ifndef MBED_SMOTOR_H
00012 #define MBED_SMOTOR_H
00013 
00014 #include "mbed.h"
00015 
00016 class sMotor {
00017 public:
00018 
00019     sMotor(PinName A0, PinName A1, PinName A2, PinName A3); //motor constructor
00020 
00021     void step(int num_steps, int direction, int speed);
00022     void anticlockwise();
00023     void clockwise();
00024 
00025 
00026 private:
00027 
00028     DigitalOut _A0;
00029     DigitalOut _A1;
00030     DigitalOut _A2;
00031     DigitalOut _A3;
00032 
00033 };
00034 
00035 #endif