SEDS Avionics Team Flight Computer 2024-2025 Season
Disclaimer: Only one sensor library was used because the flash memory was reaching its limit using the ASM330LHH library and the state machine code itself. As a result of computing restraints based on our design choice choosing the Arduino Nano as our microcontroller we decided to not use the barometer or magnetometer with their respective libraries. From this we learned our mistakes and implemented a more powerful microcontroller for the next flight computer being the Orizaba:
- ASM330:
0x6A - Magnetometer:
0x30
- IGNORE .PIO Folder: ADD the
.pioto the .gitignore to not flood the git repository and add any sensor functions from the sensor library to a seperate header file
- Single Main File: Ensure there is only ONE
.cppfile that containssetup()andloop()in yoursrcdirectory. Multiple files with these functions will cause compilation errors. - Archive Storage: If files are not intended for compilation, place them in the
archivefolder since only thesrcfolder is compiled. - Test Folder Usage: Unless you are actively testing, do not place any files in the
testfolder as it may cause errors. - Include Folder: Any custom header files should be placed in the
includefolder, which is recognized by PlatformIO as the location for header files. - Corresponding File (.cpp) for Custom Header Files for the
.cppfile that corresponds to the header file in theincludefolder make sure that it is placed in thesrcfolder so that platformIO can recognize it.
This project uses C, C++, and Arduino code for embedded systems, and we adhere to a consistent commenting style to keep the codebase clear, maintainable, and easy to navigate.
- Format: Use Doxygen-style comments (
/** ... */) before each function. - Content:
- Briefly describe the function’s purpose, parameters, and return values.
- Use
@briefto summarize the function at a high level. - Use
@paramand@returntags to document function inputs/outputs. - For any known issues, planned work, or bugs, use
TODO(#issueNumber)orFIXME(#issueNumber). - Use
NOTE(name):to highlight non-actionable observations or temporary conditions.
Example:
/**
* @brief Fetches data from a sensor and processes the result.
*
* Reads from the specified sensor pin, applies filtering, and returns the
* processed value. This function is non-blocking.
*
* @param sensorPin The Arduino analog pin number where the sensor is connected.
* @return The filtered sensor reading as an integer.
*
* NOTE(alice): Currently using a simple moving average filter. See #45 for a discussion on implementing a Kalman filter.
* TODO(#101): Integrate a calibration routine to improve accuracy.
* FIXME(#102): Handle sensor saturation conditions more gracefully.
*/
int readAndProcessSensor(int sensorPin) {
// ...
}- Format: Use Doxygen-style comments (
//) before each comment. - Content:
- Briefly describe the purpose of the code
- (Case-by-case basis) Tag anyone who will work on this code
/// This is a single-line Doxygen comment.
/// It documents myOtherVariable.
int myOtherVariable;int myVariable // Place the comment hereUse TODO(#issueNumber)or FIXME(#issueNumber) to mark pending tasks, enhancements, or additional steps you plan to implement.
Conditions:
- If going to use in a function multi-line comment you can place it inside as noted in #1 Function-Level Comments
- If going to be single line then mark it as the following below:
int calculateChecksum(uint8_t data[], size_t length) {
int checksum = 0;
for (size_t i = 0; i < length; i++) {
checksum += data[i]; // TODO(#789): Handle overflow for large data arrays.
}
return checksum;
}or
bool connectToWiFi(const char* ssid, const char* password) {
bool success = WiFi.begin(ssid, password); // FIXME(#456): Implement retry logic for failed connections.
return success;
}- If needed for a multi-line
TODO/FIXMEcomment then use the syntax as following to not clutter the code and hinder readbility:
/**
* FIXME(#456): Implement retry logic for failed connections.
*/
bool connectToWiFi(const char* ssid, const char* password) {
bool success = WiFi.begin(ssid, password);
return success;
}


