# How do I Create a pedometer using touch.acceleration?

Get help using Construct 2

### » Wed Jul 20, 2016 6:55 pm

I've experimented a few times and from what I've read it's totally possible to create one if you know how to calculate the three inputs and adjust for orientation and gravity. The only thing is the math I saw was WAAAY over my head.

but I figure if C2 has the same access to the same data then it should be possible right?

Anyone have any ideas? Here is the website I was reading about the math that goes into it
http://aosabook.org/en/500L/a-pedometer ... world.html
B
20
S
3
Posts: 70
Reputation: 1,536

### » Sat Jul 23, 2016 3:32 pm

It is definitely possible, but you will probably have to find and integrate an outside library.

Some other folks in the computer world have tried:
https://www.reddit.com/r/javascript/com ... avascript/
https://github.com/mpberk/Pedometer
https://github.com/leecrossley/cordova-plugin-pedometer
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,867

### » Sun Jul 24, 2016 1:13 am

Interesting.

There are many pedometers algorithms out there, they basically take in the accelerometer values, find any patterns and add steps

I would give it a jab although I don't have access to ny PC right now, if this question doesn't get answered tommorow, I'll give it a go.

Edit: I did some digging around, it seems that implementing a pedometet yourself would be a huge headache, you'd need data, so that means plotting graphs of accelerometer values, finding a pattern for steps in multiple conditions and designing an algorithm around that data pattern. Waste of time. The best you can do is basically write a plugin around a popular js pedometer library and hope for the best
B
43
S
18
G
17
Posts: 2,247
Reputation: 17,556

### » Mon Jul 25, 2016 2:23 pm

Yea, you just have to build the plugin framework around the JavaScript library.
If you do that please publish it for other Construct users to make use of. You can even save it on a Github to open source it.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,867