Accelerometer data usage

 

Capture Mode – Data Collection


  1. 1.  Select the Capture mode tab.

  2. 2. Select the sampling frequency, from 1 to 60 Hertz (samples per second).

  3. 3. Select the total number of samples.

  4. 4. Press Start

  5. 5. The Progress bar will show the progressing data collection.

  6. 6. At the end of data collection, you can point your web browser to the URL shown in the Web Server URL rows.

  7. 7. You will then have the CSV (comma-separated) data that you can save to a CSV file and analyze with Excel or an application of your choice.

  8. 8. [Pro] Filename will show the filename of the data in the Flash filesystem. The format of the filename is accel_MMMDDYY_HHMMSS where MMM=Month, DD=Day, YY=Year, HH=Time-Hours (24-Hour day), MM=Time-Minutes, SS=Time-Seconds.


















Streaming Mode – Data Collection


  1. 1. Select the Config mode tab to set the network communication configuration. The network communication uses UDP packets.

  2. 2. By default it uses broadcast mode, which means that all devices in the same network (such as your WLAN) will receive the packets. In case you plan to run devices in the same network, you should switch to unicast mode and specify the target IP address manually. You may also change the port to something else if you wish (remember to change it on the receiving end as well).

  3. 3. Select the Streaming mode tab.

  4. 4. Here you can switch between the actual accelerator data and manual operation modes. The sliders show the current accelerometer values. In the manual mode you can slide these yourself, generating accelerometer data manually. Note that in the manual mode you can generate data that would not be possible to generate with the actual device accelerometers.

  5. 5. You will need to run a server-side program to collect and store the UDP packets with the acceleration data. A sample Python program is available here.

  6. 6. The capture rate in streaming mode is 50 HZ.


































Streaming Mode – iPhone Simulator Integration


  1. 1. Configure the Config tab and the Streaming mode tab as described in the previous section.

  2. 2. You’ll need to integrate a simulator acceleration class into your application. These class files are  AccelerometerSimulation.h and AccelerometerSimulation.m.

  3. 3. To embed Accelerometer Simulator capabilities into your own application, add the AccelerometerSimulation.h and AccelerometerSimulation.m files into your project.

  4. 4. In the source file where you configure UIAccelerometer, add
            #import "AccelerometerSimulation.h"

  5. 5. This will override the default behavior of UIAccelerometer when run on the iPhone simulator. When building for device, nothing is changed in your application.

  6. 6. After compiling and running your application on the simulator, it should now be receiving accelerometer data from the Accelerometer Data application running on your device.

  7. 7. Should you need to use a different UDP port, you have to edit the AccelerometerSimulaton.m file and change the line:
            #define kAccelerometerSimulationPort 10552


[Pro] Capture Library


  1. 1. Clicking the Library tab allows you to manage the captured data files.

  2. 2.· Clicking Delete will delete an individual capture file. Be careful, it won’t ask you to confirm the delete.

















For More Information:


  1. The iPhone 3g appears to contain a ST LIS302DL MEMS 3-axis accelerometer data sensor. The iPhone 4g appears to contain a ST LIS331DLH accelerometer.

Pro

Pro

Pro