Active GyroCam
  • Home
    • The Big Idea
  • Videos
  • Implementation
    • Hardware
    • Software
    • Electronics
  • Market Research
  • Contact

Android code

Below is the code structure for the Android application. The application begins by displaying the opening activity and then transitions to either the internal camera activity or the external camera activity depending on the user's preferences.
Picture
  • Opening Activity

 High Level Functionality: Allows the user to choose between two options:
  1. Using the smart phone's camera to take video
  2. Using an external camera to take video
Based on the user's choice the opening activity then transitions to either the internal camera activity or the external camera activity.
This activity also provides the option to turn on airplane mode to avoid having the videoing disrupted by a phone call or text message.
Picture
  • Internal Camera Activity
Note: If this activity is used, the phone is assumed to be mounted on the movable servos. 
High Level Functionality: 
  1. Smart Phone Camera: When the user clicks start, the smart phone's camera is enabled and begins taking video on a new processing thread. When the user stops the camera, this video is saved away on the phone's hard drive for later viewing. 
  2. Sensor Reading: When the activity is started, the phone begins reading the Android gravity vector through Android's sensor Manager.
  3. Position Control: When the user clicks start, the phone sets its home orientation to be the current gravity vector. The phone then implements PID position control on the motor servos to continually return itself to its home orientation.
Picture
  • External Camera Activity
Note: If this activity is used, the phone is assumed to be rigidly mounted on the base of the device with an external camera mounted on the servos.
High Level Functionality: 
  1. Sensor Reading: When the activity is started, the phone begins reading the Android gravity vector through Android's sensor Manager.
  2. Position Control: When the user clicks start, the phone sets its home orientation to be the current gravity vector. The phone then implements position control on the motor servos to continually return them to the home orientation. Note: there is no feedback loop within the phone in this scenario since the phone's measured position is not dependent on the signal it sends to the motor servos.
Picture

Arduino Code

Below is the structure for the Arduino application.
Picture

code listings

  • Android Code

Opening Activity Java
Opening Activity XML
Internal Camera Activity Java
Internal Camera Activity XML
External Camera Activity Java
External Camera Activity XML
Android Manifest XML
  • Arduino Code

Main Arduino Source Code
Arduino Constants
Powered by Create your own unique website with customizable templates.