Project 3 Status

Sydney Mayfield

Project Idea

The idea is to create an app that has an hourgass timer on the display and uses the gyroscope sensor to determine the direction that the sand will fall.

Prototyping

lab11_sketch

Lab 12 - Sensor Info

1. What kind of data will you collect for sensors?

The data that will be collected for sensors are of types accelerometer, gravity, gyroscope, and rotation_vector. They are stored in the following units of measured by the hardware.

2. What is the range of possible values?

  1. Accelerometer = 0 to 9.81 m/s^2
  2. Gravity = 9.81 m/s^2
  3. Gyroscope = -180 degrees to 180 degrees
  4. Rotation_vector = (-180, -180, -180) to (180, 180, 180) degrees

Hardware sensors provude raw linear and rotational forces data on the device. To properly use that information, outside factors like gravity need to be filtered out.

The rotation_vector will supply axis coordinates on the current orientation of the device. An example of the range of data supplied can be seen in the following image. The

coordinate system img

The accelerometer also uses the coordinate system. However, instead of gathering coordinate information it shows the acceleration + gravity in a certain direction.

The gyroscope uses the same coordinate system to read different locations the device reaches along each axis. That information is then integrated over time to calculate the change of angles for determining rotation.

3. How will you test the sensor?

I can test these sensors in android studio by first using code like the image below to grab sensor info. Once I am able to get basic information I can see data outputs based on how I orient either the android emulator or my android device that is being used to debug.

This link from the android development kit includes the information explained above, as well as basic code integrations to be able to grab the sensor data. The code snippet for integration of the gyroscope can be seen in the following.

gyroscope code snippet

4. How did you push your project to github?

To push the project to github I created a new public repository from github, committed to, and pushed my files from within android studio on my vm.


The idea for this project was to create an hourglass sand timer that would do some math to make sand fall towards the current bottom edge of the device. When implementing the Sensor Manage in MainActivity, the app crashes on startup.

homePage mainActivity code snippet sensor code snippet from sand error capture spawner code snippet

When the sand lands at the bottom it should stop at the lowest y-axis value, but falls offscreen.