DVT_XRayClass.h angepasst
#include <analogWrite.h> entfernt PIN_XRAY_SWITCH auf 14 gesetzt PIN_KV_SWITCH auf 27 gesetzt Objekt KV_SWITCH erstellt
This commit is contained in:
parent
81d9c21e12
commit
9d23c8aec3
|
@ -30,7 +30,8 @@
|
|||
#define PIN_STEPMOTOR_ABLE 19
|
||||
#define PIN_STEPMOTOR_DIRECT 16
|
||||
#define PIN_STEPMOTOR_CLOCK 17
|
||||
#define PIN_XRAY 13
|
||||
#define PIN_XRAY 14
|
||||
#define PIN_KV_SWITCH 27
|
||||
#define PIN_FILAMENT_SWITCH 26
|
||||
/*
|
||||
* ESP32 Polyfill Lib
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define DVT_MAINCLASS_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <analogWrite.h>
|
||||
#include "DVT_Types.h"
|
||||
|
||||
class Pin {
|
||||
|
@ -48,6 +47,7 @@ Pin STEPMOTOR_ABLE = Pin(PIN_STEPMOTOR_ABLE,OUTPUT,HIGH);
|
|||
Pin STEPMOTOR_DIRECT = Pin(PIN_STEPMOTOR_DIRECT,OUTPUT,HIGH);
|
||||
Pin STEPMOTOR_CLOCK = Pin(PIN_STEPMOTOR_CLOCK,OUTPUT,HIGH);
|
||||
Pin XRAY_SWITCH = Pin(PIN_XRAY,OUTPUT,LOW);
|
||||
Pin KV_SWITCH = Pin(PIN_KV_SWITCH, OUTPUT, LOW);
|
||||
Pin FILAMENT_SWITCH = Pin(PIN_FILAMENT_SWITCH,OUTPUT,LOW);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,14 +20,16 @@ class XRay {
|
|||
this->CurState.State = true;
|
||||
this->CurState.Time = millis();
|
||||
XRAY_SWITCH.SetState(this->CurState.State);
|
||||
while (millis() - this->CurState.Time <= 20){}
|
||||
KV_SWITCH.SetState(this->CurState.State);
|
||||
sysMSG("SYSTEM: XRAY Started");
|
||||
}
|
||||
}
|
||||
void RunTime()
|
||||
{
|
||||
void RunTime() {
|
||||
if (this->CurState.State && millis() >= this->CurState.Time + this->xray_time) {
|
||||
this->CurState.State = false;
|
||||
XRAY_SWITCH.SetState(this->CurState.State);
|
||||
KV_SWITCH.SetState(this->CurState.State);
|
||||
sysMSG("SYSTEM: XRAY Stopped");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue