Revision 1.1 by Raisonance :
Project source(s) were modified to ensure compatability with Primer2. The archive is updated with a Ride project adapted to Primer2.
(Searches a free entry in the handler list, before adding a new one).
EnergyMeter is a pedometer application that gives an indication of energy consumption while walking or stationary.
The application uses the shock counter of the CircleOS MEMS handler to calculate the number of steps taken in a 10 second period. From this and the stride length the walking speed can be calculated. Using the data in  the metabolic equivalent rate (MET)* value for the activity can be calculated. From the MET value and the mass of the individual the energy consumption during the time period can be calculated using the equation:
e = 1.1622 * m * t * MET;
Where 'e' is the energy in Joules, 'm' is the individual's mass in kg, 't' is the time in seconds and MET is the MET value of the activity during this time.
From this the following data is presented on the screen of the STM32 Primer:
i) The MET value of the current activity (green)
ii) The power output in Watts (red)
iii) The total number of steps taken since the application was started (magenta)
iv) The total energy consumed since the application was started in kJoules (yellow)
v) The total energy in iv) displayed as the equivalent number of pints of beer
The idea behind EnergyMeter is to enable the relative energy required for various activities to be easily compared. It also allows this energy consumption to be related to the equivalent amount of food or drink (in this case pints of beer). It is hoped that this will allow people to more easily visualise their energy intake compared to their energy output.
Currently the individual's stride length and mass are hard-coded to 0.5m and 69kg.
If the STM32 Primer is not shocked within 25 seconds then the backlight is turned off to conserve battery power.
*A MET value of 1 is the basal metabolic rate (the rate whilst idle) and this increases with the vigour of the activity. See  for a full list of activities and their MET values.
 Ainsworth et al, "Compendium of Physical Activities: an update of activity codes and MET intensities", Medicine & Science in Sports & Exercise 2000;9:S498-S516 (http://personal.uncc.edu/jtlightf/classmats/assessment/ainsworth_MSSE_32_2000.pdf)