DVT2023/DVT_VariacClass.h

45 lines
879 B
C
Raw Normal View History

2023-11-24 21:08:24 +00:00
#ifndef DVT_VARIACLASS_H
#define DVT_VARIACLASS_H
#include "DVT_Types.h"
#include "DVT_MainClass.h"
int Limit = 0;
void IRAM_ATTR ISRVariacBack() {
Limit = 2;
STEPMOTOR_ABLE.SetState(HIGH);
}
void IRAM_ATTR ISRVariacFor() {
Limit = 1;
STEPMOTOR_ABLE.SetState(HIGH);
}
class Variac {
private:
public:
Variac() {
}
void Start() {
STEPMOTOR_ABLE.SetState(LOW);
attachInterrupt(VARIAC_LIMIT_BACK.GetPin(),ISRVariacBack,RISING);
attachInterrupt(VARIAC_LIMIT_FOR.GetPin(),ISRVariacFor,RISING);
debugMSG("Variac Started");
}
void Stop() {
STEPMOTOR_ABLE.SetState(HIGH);
detachInterrupt(VARIAC_LIMIT_BACK.GetPin());
detachInterrupt(VARIAC_LIMIT_FOR.GetPin());
debugMSG("Variac Stopped");
}
void Run() {
}
void SetSteps() {
}
};
#endif