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();
|
||||
SetupDrive();
|
||||
start_time = millis();
|
||||
//lamp.On();
|
||||
}
|
||||
|
||||
void ContactPrinter::Start () {
|
||||
|
@ -136,12 +137,15 @@ void ContactPrinter::Loop () {
|
|||
if (running) {
|
||||
drive_motor.Loop();
|
||||
frame = drive_motor.GetFrames();
|
||||
if (!lamp.IsOn() && frame >= start_after) {
|
||||
if (!lamp.IsOn() && start_lamp > 0 && frame >= start_lamp) {
|
||||
lamp.On();
|
||||
}
|
||||
/*if (frame >= 1000) {
|
||||
if (lamp.IsOn() && stop_lamp > 0 && frame >= stop_lamp) {
|
||||
lamp.Off();
|
||||
}
|
||||
if (stop_after > 0 && frame >= stop_after) {
|
||||
Stop();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
} else if (timer >= start_time + 100) {
|
||||
initialized = true;
|
||||
|
|
|
@ -53,7 +53,9 @@ class ContactPrinter {
|
|||
|
||||
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 initialized = false;
|
||||
|
|
Loading…
Reference in New Issue