element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sci Fi Your Pi
  • Challenges & Projects
  • Design Challenges
  • Sci Fi Your Pi
  • More
  • Cancel
Sci Fi Your Pi
Blog QuadCOP:  Source Code and Flow Diagrams
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: screamingtiger
  • Date Created: 28 Aug 2015 9:58 PM Date Created
  • Views 844 views
  • Likes 3 likes
  • Comments 0 comments
  • quadcop_project
  • design_challenge
  • sci_fi_your_pi
Related
Recommended

QuadCOP:  Source Code and Flow Diagrams

screamingtiger
screamingtiger
28 Aug 2015

Previous Posts Here:

http://www.element14.com/community/community/design-challenges/sci-fi-your-pi/blog/authors/screamingtiger?ICID=DCH-SciFiPi-challengers

 

 

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.

FilesDescriptionDependenciesSystemNotes
autocontrol.cppMain 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 PiRaspberry Pi
gps.cpp, gps.hMulithreaded GPS Parser and trackerTinyGPS++ ported to Pi, custom serial ISR

PThreads

Raspberry PiSerial ISR added to TinyyGPS++.cpp.

 

Runs in background parallel to autocontrol.cpp
heading.cpp, heading.cpp5883L Magnetometer heading objectWiringPiRaspberry PiSee http://wiringpi.com/
i2c.cpp, i2c.hBlock send algorithm for sending complex I2C dataWiringPiRaspberry Pi
TinyGPS++.cpp, TinyGPS++.hGPS NMEA parserCustom defines that are included with ArduinoRaspberry PiTook out millis() calls

 

See https://github.com/mikalhart/TinyGPSPlus/releases

 

See screen.cpp, screen.h
OLED screen control objectWiringPi, Adafruit_SSD1306 driversRaspberry PiSee https://github.com/adafruit/Adafruit_SSD1306
cam.pyCamera control via GPIOPythonRaspberry Pi
sensorarray.cppMain code that reads sensors and sends data via I2CArduino Wire libraryArduino
controlswitch_pic32.pdeMain Control switch code for reading and sending PWM signals for flight controlChipKit Wire and SoftPWM librariesChipKit Pi/PIC 32Also controls rotating head

 

 

Flow Diagrams

 

Header 1
Software Interconnection Diagram
image
autocontrol.cpp (RPFS)
image
controlswitch_pic32 (ControlSwitch)
image
sensorarray.cpp (Sensor Array)
image
I2C Block Protocol
image
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube