quentin godbert
/
t2-stm32-lift
interrupt géré compil ok sans isr
Fork of T2_STM32 by
lift.h
- Committer:
- Tioneb
- Date:
- 2018-02-05
- Revision:
- 5:d6484db1ec5c
- Child:
- 6:6291f032e996
File content as of revision 5:d6484db1ec5c:
//Ne pas oublier la détection de surintensité #define PeakCurrent 510 // Valeur à vérifier class Lift { public: Lift(int, int, int); ~Lift(void); void Starting(); void Stopping(); void GoUp(); void GoDown(); private: bool InMotion; char sTargetPos, PreviousPos, CurrentPos; int StepPin, spinDown, sMiddleSensor, CurrentSensor, tempStepPin, tempDirPin; }; Lift::Lift( LIFTSTEPPIN, LIFT_DIRPIN, LIFT_CURRENTSENSOR){ DigitalOut Step(LIFTSTEPPIN); DigitalOut Dir(LIFTDIRPIN); } void Lift::Starting(){ int i; for(i=0; i<128; i++){ SendPWM_Carre(i, StepPin); delay(10); } } void Lift::Stopping(){ int i; for(i=128; i>0; i--){ SendPWM_Carre(i, StepPin); delay(10); } } void Lift::GoUp(){ DirPin = 0; Starting(); Started(); } void Lift::GoDown(){ DirPin = 1; Starting(); } #endif