We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-06-18
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 2813 times
Not followed.
License: MIT license
Pedometer Click is designed to sense movement, more precisely, to sense and count steps taken by its user. It is equipped with the STP201M module, a 3D pedometer module with an IC chipset, which includes a precise G-sensor and MCU.
Do you want to subscribe in order to receive notifications regarding "Pedometer click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Pedometer click" changes.
Do you want to report abuse regarding "Pedometer click".
Library Description
The library contains all the necessary functions for detecting and reading the steps.
Key functions:
uint8_t pedometer_process()
- Pedometer process.uint32_t pedometer_getStepCounter()
- Functions for get step counter.void pedometer_resetStepCounter(uint32_t newCnt)
- Functions for reset Step counter.Examples description
The application is composed of three sections :
void applicationTask()
{
uint8_t newStep;
uint32_t stepCounter;
char demoText[ 50 ];
newStep = pedometer_process();
if(newStep == PEDOMETER_NEW_STEP_DETECTED)
{
stepCounter = pedometer_getStepCounter();
LongWordToStr(stepCounter, demoText);
mikrobus_logWrite(" Step Counter : ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
mikrobus_logWrite("---------------------------", _LOG_LINE);
Delay_ms( 50 );
}
}
Other mikroE Libraries used in the example:
Conversions Library
UART Library
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.