This is the code for deployment of the Payload for NASA's 2019 SLI Payload challenge. During flight, at approximately 400 feet, we will remotely trigger separation of the payload section via radio; and later trigger release of the drone.
We are using the Adafruit Feather LoRa 32u4 (RFM9x) with the RadioHead (RFM9x) library.
We are using the Adafruit Micro-SD Breakout Board.
- Open the code in the Arduino IDE
- Follow these steps for installing the drivers for the Feather
- In
Arduino > Preferences
, under "Show verbose mode during" check both compilation and upload (this solves some issues with the board) - Install the RadioHead library (Note: Find the folder to put this in by going to Arduino -> Preferences -> Sketchbook location. Open this folder and there should be a folder called libraries in there. Put the unzipped library inside there.)
- DO NOT SEND CODE OVER SLACK/IMESSAGE/FB
- Use branches and PRs -- this way we can do code reviews and learn git the proper way
- Write clean code
- Heavily comment your code, so that it's easier for people who aren't familiar with C/C++/coding in general to understand it
- Make flowcharts with proper conventions for the code you write so we can A) help visualize it and B) put in documents
- Record known issues in known issues
- The curly bracket must be on the same line as the function declaration
void myFunction() {
// Good
}
void myShittyFunction()
{
// Bad
}
In Mac this state looks like nothing showing up under ports, on the PC it gives an error like "device not recognized". Check out the Feather troubleshooting guide for more info.
- First, double check that you have verbose mode enabled (see Instructions to run).
- Double check that your USB cable is not charge-only
- Upload Blink (File -> Examples -> 0.1 Basics -> Blink), and hit the reset button shortly after clicking upload. The builtin LED should begin pulsing.
- If this doesn't work, follow the following steps to re-burn the bootloader:
The bootloader may need to be burned if you flash code that causes a program halt. This will result in the "board not recognized" issue.
- Obtain the bootloader (Pololu USB AVR Programmer v2.1), a micro-USB cable, and a computer with Arduino IDE installed
- Using a breadboard, connect the following:
Bootloader | Feather |
---|---|
GND | GND |
MOSI | MO |
VCC | 3v |
RST | RST |
SCK | SCK |
MISO | MI |
- Plug in the USB cable to the bootloader (NOT the feather) and your computer
- Under ports, there should be two USB devices showing up. Select the first one (I'm not sure it matters, but this is what has always worked for me)
- In the Arduino IDE, under
Tools > Programmer
, select "Atmel STK500 development board" - Click "Burn bootloader"
The board should now be recognized by your computer and able to flash. You can verify this by uploading Blink (File -> Examples -> 0.1 Basics -> Blink
)
Be sure to not flash your bad code again so you don't have to repeat this!