Add variables to start and stop lamp and alternately stop the machine after x number of frames
This commit is contained in:
parent
a2c092d57c
commit
6cf8f62a42
|
@ -29,6 +29,7 @@ void ContactPrinter::Setup () {
|
||||||
SetupTakeup();
|
SetupTakeup();
|
||||||
SetupDrive();
|
SetupDrive();
|
||||||
start_time = millis();
|
start_time = millis();
|
||||||
|
//lamp.On();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactPrinter::Start () {
|
void ContactPrinter::Start () {
|
||||||
|
@ -136,12 +137,15 @@ void ContactPrinter::Loop () {
|
||||||
if (running) {
|
if (running) {
|
||||||
drive_motor.Loop();
|
drive_motor.Loop();
|
||||||
frame = drive_motor.GetFrames();
|
frame = drive_motor.GetFrames();
|
||||||
if (!lamp.IsOn() && frame >= start_after) {
|
if (!lamp.IsOn() && start_lamp > 0 && frame >= start_lamp) {
|
||||||
lamp.On();
|
lamp.On();
|
||||||
}
|
}
|
||||||
/*if (frame >= 1000) {
|
if (lamp.IsOn() && stop_lamp > 0 && frame >= stop_lamp) {
|
||||||
|
lamp.Off();
|
||||||
|
}
|
||||||
|
if (stop_after > 0 && frame >= stop_after) {
|
||||||
Stop();
|
Stop();
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
} else if (timer >= start_time + 100) {
|
} else if (timer >= start_time + 100) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
|
@ -53,7 +53,9 @@ class ContactPrinter {
|
||||||
|
|
||||||
volatile uint8_t load = 2; //0 = no load, 1 = single thread, 2 = dual thread
|
volatile uint8_t load = 2; //0 = no load, 1 = single thread, 2 = dual thread
|
||||||
|
|
||||||
volatile uint32_t start_after = 24;
|
volatile uint32_t start_lamp = 24;
|
||||||
|
volatile uint32_t stop_lamp = -1;
|
||||||
|
volatile uint32_t stop_after = -1;
|
||||||
|
|
||||||
volatile bool takeup_dir = true;
|
volatile bool takeup_dir = true;
|
||||||
volatile bool initialized = false;
|
volatile bool initialized = false;
|
||||||
|
|
Loading…
Reference in New Issue