OFF
MIKROE-1822
29 g
Status:
ROTARY G Click is a compact add-on board that allows you to add a precision input knob to your design. This board features a combination of a high-quality rotary encoder, the EC12D1564402, and a LED ring composed of 16 individual green LEDs. The 16-segment LED ring is driven by two SN74HC595 SPI-configurable 8-bit shift registers from Texas Instruments, which can control each LED individually, allowing various lighting effects to be programmed. The encoder outputs A and B signals (out of phase to each other) on the two mikroBUS™ lines, alongside the knob push-button feature, which outputs through the interrupt line. This Click board™ can be used for various interesting visual effects to any application, such as flexible position, value indicator, or many others.
ROTARY G Click is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
This product is no longer in stock
Availability date:
ROTARY G Click is based on two SN74HC595 SPI-configurable 8-bit shift registers from Texas Instruments that, combined with a high-quality rotary encoder, the EC12D1564402, allows you to add a precision input knob to your design. The EC12D1564402 incremental rotary encoder is surrounded by a ring of 16 green LEDs where a single rotation is divided into 15 discrete steps (in contrast to a potentiometer, a rotary encoder can be spun around continuously). This Click board™ is an ideal solution for building various HMI applications where precise input is required, but also for some interesting visual effects to any application.
As mentioned before, this Click board™ uses the EC12D1564402, a 15-pulse incremental rotary encoder with a push-button, from ALPS. This encoder has unique mechanical specifications (debouncing time for its internal switches goes down to 2ms), and it can withstand a huge number of switching cycles, up to 30.000. The supporting debouncing circuitry allows contacts to settle before the output is triggered fully.
The SN74HC595 controls each LED individually positioned in a ring around the encoder through a standard SPI interface with a maximum frequency of 5MHz. Rotating the encoder, it outputs A and B signals (out of phase to each other) on the two mikroBUS™ lines, AN and PWM pins of the mikroBUS™ socket, alongside the push-button contact, which outputs through the interrupt line of the mikroBUS™ socket. The SN74HC595 also comes with a Reset feature used across RST mikroBUS™ line.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the PWR SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Type
Rotary encoder
Applications
Can be used for various interesting visual effects to any application, such as flexible position, value indicator, or many others
On-board modules
SN74HC595 - SPI-configurable 8-bit shift registers from Texas Instruments
EC12D1564402 - 15-pulse incremental rotary encoder with a push-button from ALPS
Key Features
High quality, SPI interface, various lighting effects, knob feature, low power consumption, flexibility, efficiency, precision, and more
Interface
Analog,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
This table shows how the pinout on ROTARY G Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
LD2-LD17 | 1-16 | - | Rotary Green LED Indicators |
JP1 | PWR SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | - | 5 | V |
Operating Life | - | - | 30.000 | cycles |
We provide a library for the ROTARY G 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.
Library Description
This library contains API for ROTARY G Click driver.
Key functions
rotaryg_generic_transfer
ROTARY G data transfer function.
rotaryg_turn_on_led_by_position
Function turn on led by position
rotaryg_button_push
Function return 1 if button is pushed and return 0 if not
Example Description
The demo application controls led on click with rotary on board.
void application_task ( void ) {
rotaryg_turn_on_led_by_data( &rotaryg, led_data );
// Push button
if ( rotaryg_button_push( &rotaryg ) ) {
new_state = 1;
if ( new_state == 1 && old_state == 0 ) {
old_state = 1;
led_state = ( led_state + 1 ) % 5;
if ( led_state == 4 ) {
for ( old_state = 0; old_state < 17; old_state++ ) {
rotaryg_turn_on_led_by_data( &rotaryg, 0xAAAA );
Delay_ms( 100 );
rotaryg_turn_on_led_by_data( &rotaryg, 0x5555 );
Delay_ms( 100 );
}
for ( old_state = 0; old_state < 17; old_state++ ) {
rotaryg_turn_on_led_by_position( &rotaryg, old_state );
Delay_ms( 100 );
}
led_state = 0;
led_data = rotaryg_get_led_data( led_state );
}
else {
led_data = rotaryg_get_led_data( led_state );
}
}
}
else {
old_state = 0;
}
// Rotate Clockwise and CounterClockwise
if ( rotaryg_get_eca_state( &rotaryg ) == rotaryg_get_ecb_state( &rotaryg ) ) {
old__rot_state = 0;
start_status = rotaryg_get_eca_state( &rotaryg ) && rotaryg_get_ecb_state( &rotaryg );
}
else {
new_rotate_state = 1;
if ( new_rotate_state != old__rot_state ) {
old__rot_state = 1;
if ( start_status != rotaryg_get_eca_state( &rotaryg ) ) {
led_data = ( led_data << 1 ) | ( led_data >> 15 );
}
else {
led_data = ( led_data >> 1 ) | ( led_data << 15 );
}
}
}
}
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. UART terminal is available in all MikroElektronika compilers.
This Click board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.
NOTE: Please be advised that any peripheral devices or accessories shown connected to the Click board™ are not included in the package. Check their availability in our shop or in the YMAN section below.