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: 2020-03-04
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Optical
Downloaded: 3158 times
Not followed.
License: MIT license
Index Counter Click is a simple prototyping high precision Hall-Effect switch solution with direction detection.
Do you want to subscribe in order to receive notifications regarding "Index Counter click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Index Counter click" changes.
Do you want to report abuse regarding "Index Counter click".
Library Description
The library covers all the necessary functions to control Index Counter click board. The library contains a function that shows the status of the pins - direction and speed.
Key functions:
uint8_t indexcounter_get_dir
( void )
- Get state of the direction pin function.uint8_t indexcounter_get_speed
( void )
- Get state of the speed pin function.
The application is composed of three sections
void application_task ( )
{
speed_state = indexcounter_get_speed( );
dir_state = indexcounter_get_dir( );
if ( enable_speed && speed_state )
{
pulse_ms = time_cnt - start_timer;
start_timer = time_cnt;
speed_rpm = INDEXCOUNTER_ONE_MIN_CONV_MS / ( pulse_ms * n_pole_pairs );
enable_speed = INDEXCOUNTER_SPEED_DISABLE;
log_display ( speed_rpm );
}
if ( ( !enable_speed ) && ( ! speed_state ) )
{
enable_speed = INDEXCOUNTER_SPEED_ENABLE;
}
}
void log_display ( float rpm_val )
- The function displays all results and a float value with a comma with two decimal places.Other
Additional notes and
Depending on the development board you are using, you may need USB UART click,