This commit is contained in:
2022-11-13 22:53:56 +01:00
commit 0598c09364
1324 changed files with 4446777 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#ifndef STEPPER_SIM_H
#define STEPPER_SIM_H
#include "base.h"
#include "arduinoIO.h"
class stepperSim : public simBaseComponent
{
private:
int minStepValue;
int maxStepValue;
int stepValue;
bool invertDir;
int enablePin, stepPin, dirPin;
int minEndstopPin, maxEndstopPin;
public:
stepperSim(arduinoIOSim* arduinoIO, int enablePinNr, int stepPinNr, int dirPinNr, bool invertDir);
virtual ~stepperSim();
virtual void draw(int x, int y);
void setRange(int minValue, int maxValue) { minStepValue = minValue; maxStepValue = maxValue; stepValue = (maxValue + minValue) / 2; }
void setEndstops(int minEndstopPinNr, int maxEndstopPinNr);
int getPosition() { return stepValue; }
private:
void stepPinUpdate(int pinNr, bool high);
};
#endif//STEPPER_SIM_H