-1

I'm trying to create a pedometer for an app that I'm coding in CoronaSDK, though I'm not really sure where to start. I know that I need to create an algorithm/equation from the accelerometer data that is accessible. (https://docs.coronalabs.com/api/event/accelerometer/index.html).

Any help or hints with an algorithm would be appreciated.

Piglet
  • 27,501
  • 3
  • 20
  • 43

1 Answers1

0

Here's what Coronalabs says about this:

Corona SDK does not have any API's or any plugins that can count steps. However you do have access to the acceleromenter which gets you the raw data on the device's movement and compute steps yourself, but this will only work while the phone is awake and the app is in the foreground. Corona SDK is not designed to run in the background. There is an assumption that there is a screen to draw to each frame.

We do have a product called Corona Enterprise that lets you talk to other native SDKs. You could use it to collect your native data and in theory have it run in the background and when the app wakes up, send the collected data to the Lua/Corona portion of the app to display.

So if this doesn't stop you you could try to implement this:

Opening the Black Box: Publishing Pebble’s activity-tracking algorithms where they basically look for the most rhythmic frequency within a 5 second interval. If the calculated score is above a certain threshold it's considered running or walking.

Piglet
  • 27,501
  • 3
  • 20
  • 43