diff --git a/include/teensy.h b/include/teensy.h index 94d76e0..f7154d5 100644 --- a/include/teensy.h +++ b/include/teensy.h @@ -230,7 +230,21 @@ void thrustInfo(Vehicle &State) { State.burnStart = State.time; State.burnElapsed = 0.0; + // Save load cell values before ignition + double lc_val = State.lc0_processed + State.lc1_processed + + State.lc2_processed + State.lc3_processed; + + // CONTACT + Serial.println("CONTACT"); digitalWrite(pin_igniter, HIGH); + + // Wait for motor to start burning + Serial.println("waiting for motor to start."); + while (lc_val * 1.5 < State.lc0_processed + State.lc1_processed + + State.lc2_processed + State.lc3_processed) { + ; + } + State.thrustFiring = 1; } else if (State.thrustFiring == 1) {