Libary for Strpper motor controller, eg: Rep-Rap smart stick Catering for both, Phisical 'PIN' endstops, and PORT Expander end stops . ** BOTH IN TEST ** ** Phisical PIN tested (minimal) **** PORT PIN NOT TESTED ****

Stepper.h

Committer:
ceri
Date:
2013-07-29
Revision:
1:66e95666c3b5
Parent:
0:a509cc91f7c2
Child:
3:57d3774612fc

File content as of revision 1:66e95666c3b5:



#ifndef _stepper_h_
#define _stepper_h_

#include "mbed.h"

class Stepper {

public:

    Stepper(PinName Step, PinName Dir, PinName En, PinName Endstop_Left, PinName Endstop_Right, bool Invert_Dir, bool Invert_ESL, bool Invert_ESR);
    
    bool Pulse();
    bool Set_Dir (bool Dir2Set);
    bool ESL_Activeated();
    bool ESR_Activeated();
    bool ESL_Fitted();
    bool ESR_Fitted();
    
    bool Enable (bool OnOff);

protected:
    DigitalOut  _Step;    
    DigitalOut  _Dir;
    DigitalOut  _En;
    
    DigitalIn _Endstop_Left;    
    DigitalIn _Endstop_Right;
    
    
    bool _Invert_Dir;
    bool _Invert_ESL;
    bool _Invert_ESR;
    bool _g4;
    
    bool ESL; 
    
private:
       
    int ESR; 
    int Set; 
    
    };

#endif // _stepper_h_