Previous Posts Here:
Well its time to post my source code. Everything is written in C++ across 3 platforms. The Pi 2, ChipKit Pi, and Arduino. I used some advance features in C++ such as I2C, buffered serial communication, and PThreads.
I uploaded everything to GitHUB and still have an update to do to get the latest major version, as well as clean out some junk. The GitHub is located at
https://github.com/screamingtiger/QuadCOP
Here is the Manifest. All code is completely custom except TinyGPS++ and the Adafruit library for the OLED. However I have made wrappers around this code.
Files | Description | Dependencies | System | Notes |
---|---|---|---|---|
autocontrol.cpp | Main control code for the Raspberry Pi Flight System (RPFS). Gets sensor information and responds to events. Navigates and records waypoints. | All other code for Raspberry Pi | Raspberry Pi | |
gps.cpp, gps.h | Mulithreaded GPS Parser and tracker | TinyGPS++ ported to Pi, custom serial ISR PThreads | Raspberry Pi | Serial ISR added to TinyyGPS++.cpp. Runs in background parallel to autocontrol.cpp |
heading.cpp, heading.cpp | 5883L Magnetometer heading object | WiringPi | Raspberry Pi | See http://wiringpi.com/ |
i2c.cpp, i2c.h | Block send algorithm for sending complex I2C data | WiringPi | Raspberry Pi | |
TinyGPS++.cpp, TinyGPS++.h | GPS NMEA parser | Custom defines that are included with Arduino | Raspberry Pi | Took out millis() calls See https://github.com/mikalhart/TinyGPSPlus/releases |
See screen.cpp, screen.h | OLED screen control object | WiringPi, Adafruit_SSD1306 drivers | Raspberry Pi | See https://github.com/adafruit/Adafruit_SSD1306 |
cam.py | Camera control via GPIO | Python | Raspberry Pi | |
sensorarray.cpp | Main code that reads sensors and sends data via I2C | Arduino Wire library | Arduino | |
controlswitch_pic32.pde | Main Control switch code for reading and sending PWM signals for flight control | ChipKit Wire and SoftPWM libraries | ChipKit Pi/PIC 32 | Also controls rotating head |
Flow Diagrams
Header 1 |
---|
Software Interconnection Diagram |
autocontrol.cpp (RPFS) |
controlswitch_pic32 (ControlSwitch) |
sensorarray.cpp (Sensor Array) |
I2C Block Protocol |