1

I'm trying to collect data for a machine learning project I'm working on. What I'd like to do is collect accelerometer data from an iPhone, save it to a csv and email it to myself. My app currently is able to acquire data from the accelerometer, but I'm at a bit of a loss as to how to proceed. First of all, I'd like to acquire data for a preset amount of time (after playing a sound to the user) which I don't really know how to do, and I can't find good documentation for. Also, I'd like to save that to a csv, which there is some documentation on (specifically using the NSString writeToFile method). Any recommendations/ ideas?

Thanks!

  • 1
    For the CSV part, see these questions: http://stackoverflow.com/questions/1159576/how-to-export-data-to-a-csv-file-with-iphone-sdk-3-0 and http://stackoverflow.com/questions/1512883/how-to-convert-data-to-csv-or-html-format – Brad Larson Jun 18 '10 at 14:51

1 Answers1

1

Take it one step at a time.

You can set an NSTimer to get a callback at some point in the future and at the callback you can stop your data acquisition.

EDIT: You can also use a performSelector:withObject:afterDelay: to get a callback after a time delay to stop data acquisition.

This SO question has answers with example code for both methods.

Community
  • 1
  • 1
progrmr
  • 75,956
  • 16
  • 112
  • 147