A fork of a fine man's work. simplified. No microstepping etc, just a work in progress

Fork of BipoarStepperMotor by Harsha vardan

sMotor.h

Committer:
InBrewJ
Date:
2015-02-03
Revision:
4:a3d8d60147dd
Parent:
3:944e51dd1e4c
Child:
5:f9404f00deda

File content as of revision 4:a3d8d60147dd:

/*
##############################################
##Original Program Created by Harshavardan61##
##############################################
        ---- harshavardan61@gmail.com -----
Extended by Jason Brewer 2015
to adapt to the stepper motor + linear actuator
supplied by Selim Yilmaz

*/
#ifndef MBED_SMOTOR_H
#define MBED_SMOTOR_H

#include "mbed.h"

class sMotor {
public:

    sMotor(PinName A0, PinName A1, PinName A2, PinName A3, const int maxSteps); //motor constructor

    void step(int num_steps, int direction, int speed);
    void anticlockwise(int num_steps);
    void clockwise(int num_steps);


private:

    DigitalOut _A0;
    DigitalOut _A1;
    DigitalOut _A2;
    DigitalOut _A3;
    int _motorPosition;
    int _maxSteps;

};

#endif