Skip to content

This repository is the Vinson SRAD Main flight computer code for the Arduino Nano that will be guiding the rocket.

Notifications You must be signed in to change notification settings

FIU-SEDS/Vinson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VINSON FLIGHT COMPUTER CODE

SEDS Avionics Team Flight Computer 2024-2025 Season

Design

Image 1 Image 2

Result

Image 1 Image 2


Sensor Libraries Directory:

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: Orizaba Repo

ASM330LHH Main IMU


Sensor I2C Addresses:

  • ASM330: 0x6A
  • Magnetometer: 0x30

LESSONS learned from VINSON FLIGHT COMPUTER SUBSCALE:

  • IGNORE .PIO Folder: ADD the .pio to the .gitignore to not flood the git repository and add any sensor functions from the sensor library to a seperate header file

GUIDELINES for Setting up Platform.IO

  • Single Main File: Ensure there is only ONE .cpp file that contains setup() and loop() in your src directory. Multiple files with these functions will cause compilation errors.
  • Archive Storage: If files are not intended for compilation, place them in the archive folder since only the src folder is compiled.
  • Test Folder Usage: Unless you are actively testing, do not place any files in the test folder as it may cause errors.
  • Include Folder: Any custom header files should be placed in the include folder, which is recognized by PlatformIO as the location for header files.
  • Corresponding File (.cpp) for Custom Header Files for the .cpp file that corresponds to the header file in the include folder make sure that it is placed in the src folder so that platformIO can recognize it.

Commenting Standards

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.

1. Function-Level Comments

  • Format: Use Doxygen-style comments (/** ... */) before each function.
  • Content:
    • Briefly describe the function’s purpose, parameters, and return values.
    • Use @brief to summarize the function at a high level.
    • Use @param and @return tags to document function inputs/outputs.
    • For any known issues, planned work, or bugs, use TODO(#issueNumber) or FIXME(#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) {
    // ...
}

2. Single-Level Comments (Above or Inline)

  • 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 here

3. TODO/FIXME Comments

Use 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/FIXME comment 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;
}

About

This repository is the Vinson SRAD Main flight computer code for the Arduino Nano that will be guiding the rocket.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •