My favorite thing about running & biking is the fact that I can shove as many tacos in my face as I want when I’m done.
Seriously, I love tacos.
When I’m running, all I can think about is tacos. Sometimes, I think about pizza, but mostly it’s tacos. I often wonder, “how many tacos can I eat when I get home?”.
It has come to the point where I now need real-time data on how many tacos I’ve earned during a run.
So I wrote an app for my Suunto GPS watch, that tells me just that.
This app could have been so easy - if only I had a heart rate monitor. Then, it’s really just calories burned = tacos you can eat. But I don’t have one of those. I had to dive deep into the scary world of math.
I figured I couldn’t be the ONLY person in the world that needed real-time tacos earned data. I figured I should probably write this app for all the people of the world, which presented a few challenges.
Users of the Suunto platform, Movescount, can enter personal data about themselves. Things like age, weight, height, gender, etc. They can also opt out of those shenanigans and just be anonymous.
First, I need to grab their age and height. This info will come in handy for later calculations. If they don’t have any of that information, I assign them some default values of ‘average’ people.
I also want to find out if the user has a heart rate monitor, so they can pass go and collect 200 tacos.
I learned that everyone burns an average amount of calories per day that can be calculated based on their gender, age, height, and weight. In order to properly calculate how many tacos a person can earn on a run, I need to first find their BMR to use as a base number.
I don’t know, whatever.
Here’s a fun math equation for figuring that number out if you have all the numbers.
The following code handles that based on information we can get from a user’s profile on Movescount.
There’s this thing called a MET or metabolic equivalent. This is defined as the ratio of metabolic rate during a specific physical activity to a reference metabolic rate, set by convention to 3.5 ml O2·kg−1·min−1.
All I know is that there is a chart that assignes a MET to an activity, running is an 8 on the MET scale.
All this tacos earned business really comes down to how active you are for how long. Luckily, Suunto gives me that value in seconds. Unfortunately, my big equation needs it in hours.
Fortunately, I can do the math.
To find out how many calories a person burns while running, based on their age, height, weight and gender all you have to do is take their BMR divide it by 24 (to find how many calories they burn in an hour), multiply that number by the MET value and then multiply that number by activity duration. Obviously.
Cool, so that’s how many calories a person burns on a run, but how many tacos have they earned? That is the burning question.
Actually, the burning question is how many calories are in a taco? Well, that’s still up for debate, but let’s just say the average healthy runner would go to Chipotle and order a corn soft shell taco with chicken, brown rice, lettuce, and cheese. Because they’re healthy like that. They would then consume 271 calories per taco if they went that way.
Calories burned divided by calories in a taco (271) equals tacos earned!
This can all be easily solved if the user has a heart rate monitor which just gives you calories burned based on heart rate. Which is probably a more accurate way to calculate things than letting a designer try to do math.
Here’s all the code below for your consumption. You can download the app to your compatible Suunto watch over at Movescount.