TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136552 times)
  2. FAT32 Library (69746 times)
  3. Network Ethernet Library (55849 times)
  4. USB Device Library (46189 times)
  5. Network WiFi Library (41811 times)
  6. FT800 Library (41001 times)
  7. GSM click (28930 times)
  8. PID Library (26386 times)
  9. mikroSDK (26289 times)
  10. microSD click (25303 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Index Counter click

Rating:

5

Author: MIKROE

Last Updated: 2020-03-04

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Optical

Downloaded: 2789 times

Not followed.

License: MIT license  

Index Counter Click is a simple prototyping high precision Hall-Effect switch solution with direction detection.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Index counter click

Index counter click

Native view of the Index counter click board.

View full image
Index counter click

Index counter click

Front and back view of the Index counter click board.

View full image

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.

 

Examples description

The application is composed of three sections :

  • System Initialization - Initializes GPIO, sets DIR ( AN ) and SPD ( RST ) pins as input and begins to write a log.
  • Application Initialization - Initialization driver enables - GPIO, performs a control of the timer counter ( resolution of 1ms ) and sets the value of the timer counter, starting timer and number of pairs of rotating poles, also write log.
  • Application Task - (code snippet) This is an example which demonstrates the use of the Index Counter click board. This example shows the direction of movement, Rotations Per Minute ( RPM or speed ) of the three pairs of rotating poles positioned in the sensor operating range. Results are being sent to the Usart Terminal where you can track their changes.
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 mikroE Libraries used in the example:

  • GPIO
  • UART

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

 

 

ALSO FROM THIS AUTHOR

Hall Current click

5

This project is a simple demonstration of working with the Hall Current Click board based on the TLI4970 high precision miniature coreless magnetic current sensor with SPI Interface. This example demonstrates measuring the current drawn by the consumer.

[Learn More]

GNSS 4 click

5

GNSS 4 click carries SAM-M8Q patch antenna module from u-blox.

[Learn More]

Cap Touch 6 click

0

Cap Touch 6 Click is a compact add-on board that easily integrates projected capacitive touch into users' applications. This board features the IQS227D, a single-channel capacitive controller with an internal voltage regular and reference capacitor from Azoteq. Besides the capacitive sensing area, this board also has output pins for proximity and touch events with their corresponding LED indicators. The IQS227D automatically tracks slow varying environmental changes via various filters.

[Learn More]