Starting the sensors (IMU, BME, and GPS) Should turn on and turn off quickly, if it lasts 5 seconds something is probably wrong. Likely the power is not on.
The IMU needs to be calibrated. Move board/payload around until it goes off.
One or more of the sensors (IMU, BME, or GPS) is not working. Payload needs to be power cycled to try again. Likely cause is the power is not on.
Something happened with the enum and it got set to a state that does not exist. Almost definitely a code problem
Timer If you use parenthesis it gets mad
Resets start of the timer to current time
Returns time since start or last reset of timer in millis
Returns time since start or last reset of timer in millis
Returns time since start or last reset of timer in seconds
Returns time since start or last reset in minutes
Returns time since start or last reset in hours
Returns time since start or last reset in hours To be used in timer string
Returns the minutes of the time not including hours To be used in timer string
Returns the seconds of the time not accounted for by hours or minutes To be used in timer string
Returns the milliseconds of the time not accounted for by hours, minutes, or seconds To be used in timer string
Returns a string of the time in the format hh:mm:ss.sss Includes padding zeros
missionTime; hazardTimer; Only use in loop1 or things could break errorTimer; Used to control LEDs when they are showing an error logTimer; Timer for the data logging oPIDTimer; Timer for the orientation PID vPIDTimer; Timer for the velocity PID
Child of Timer If creating but using later, input 0
CountdownTimer(long time) CountdownTimer() If no time is given, lets it not crash
Changes the countdown to whatever the newTime is If you call CountdownTimer.reset(5000), it will
If timer is less than 0, returns true If timer is not done yet, return false
Returns time left on timer in milliseconds
Returns time left on timer in milliseconds You might be able to use the other types of get time from Timer, but I have no clue if that will work.
sensorSetup; aOnCountdown; aCountdown; bOnCountdown; bCountdown;
Makes sure that the imu data is up to date
Takes in percentage for how strong you want the signal to be Positive for Solenoid CW and negative for Solenoid CCW Starts timers for PWMLoop to use to control solenoids If either timer is running, function will return Deadzone from -.075 to .075, if between these values all timers will be set to 0 and the solenoids will be off If value is greater than .9 or less than -.9, value will be set to .9 or -.9 to save gas The smaller of either on or off will be set to the min cycle time, while the larger will be set to the ratio of the larger value and the smaller value times the minimum time
To be used on every loop to act on the timers that are started in PWMSetup If aOnTimer is still going it will open up the CW Solenoid, if bOnTimer is going it will open the CCW Solenoid, and if neither timer is going it will close both
Blinks the two debug leds and the integrated LED, with each being on as long as is inputted to frequency.
Prints the required telemetry to the data logger as often as is passed into the frequency
Prints everything inside it only as often as is passed into frequency Checks if the printTimer.getTime() > frequency, if true will print everything and then reset the timer.
Always reset all regular timers at the end of Setup() Make sure to set the gyro to degrees and then DON”T DO IT AGAIN
Don’t exit setup1() until setup is complete
Enum that holds the current flight state
Mission State during Setup Continues to FLIGHT_READY as soon as the setup function is over
Exit Condition to ASCENT: Upwards velocity is greater than 3m/s or altitude is greater than 1000m
Exit Condition to CONTROLLED: BME altitude is greater than 18km or GPS altitude is greater than 18km
Exit Condition to FREEFALL: Altitude is less than 18 km or vertical velocity is negative
Exit Condition to LANDED: Vertical Velocity is 0 (or close to it, likely 0.5m/s threshold) or altitude is less than 200m
Never exits, should blink lights until found and powered off
Use to make sure loop and loop1 don’t access the same thing at the same time.
while(semaphore); semaphore = true; Use the thing; semaphore = false;
bool missionTimeSem; Use when getting total mission time bool flightStateSem; Use when getting the flightState bool bmeAltSem; Use when getting altitude from bme bool bmeTempSem; Use when getting temp from bme bool imuAccelSem; Use when getting acceleration from imu bool imuGyroSem; Use when getting gyroscope data from imu bool imuOrientSem; bool gpsLatSem; Use when getting latitude from gps bool gpsLongSem; Use when getting longitude from gps bool gpsAltSem; Use when getting altitude from gps