rotaryb
2.0.0.0
|
Rotary B Click carries a 15-pulse incremental rotary encoder with detents, surrounded by a ring of 16 blue LEDs. It’s a perfect solution for adding a precision input knob to your design. The encoder outputs A and B signals (out of phase to each other); the knob also acts as a push-button which sends an interrupt to the target board MCU. The LED ring is controlled through SPI lines (CS, SCK, MISO, MOSI). Rotary Click™ can be used with either a 3.3V or 5V power supply.
We provide a library for the RotaryB Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
This library contains API for RotaryB Click driver.
rotaryb_cfg_setup
Config Object Initialization function. rotaryb_init
Initialization function. rotaryb_generic_transfer
ROTARY B data transfer function. rotaryb_turn_on_led_by_position
Function turn on led by position rotaryb_button_push
Function return 1 if button is pushed and return 0 if not The demo application controls led on Click with rotary on board.
The demo application is composed of two sections :
Initializes SPI driver, set initial states, set RST logic high and performs device configuration.
Show functionality of Rotary_R Click, rotating and turn on/off led's, using the SPI interface.
In orther to use all of the clicks functionality, pull down INT pin.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
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.