How does it work?
Thumbwheel Click is based on the DH101ALSMT001, 10-position thumb wheel switch from Apem. The combination of copper alloy, hard gold, stainless steel, and plastic housing makes it very robust. The thumb wheel switch has four basic pins as outputs on this Click board™, pulled down. By selecting one of the positions, the wheel switch internally connects up to four of those pins to a common VCC. The combination of the pulled-up pins can be read, thus letting the host MCU know what position of the Thumbwheel click is selected.
To make things easier, this Click board™ features the DS2408, a 1-Wire 8-channel addressable switch from Analog Devices. It is a programmable I/O device with open drain outputs that can individually capture the state changes at the PIO inputs for interrogation by the bus master. The four output pins from the DH1 are connected to the corresponding IO pins of the DS2408. To communicate to the host MCU, the DS2408 uses a 1-Wire interface with a single digital signal at 15.3Kbls, or 100Kbps. For communication, you can choose between OW0 or OW1pins of the mikroBUS™ socket over the GP SEL (OW1 selected by default). The DS2408 has a unique factory-lasered 64-bit registration number so that more Thumbwheel Clicks can be used on a single bus.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can 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.
Specifications
Type
Pushbutton/Switches
Applications
Can be used for the development of applications for simple input devices on a variety of instruments, machines, and similar devices
On-board modules
DH101ALSMT001 – 10-position thumb wheel switch from Apem
DS2408 – 1-Wire 8-channel addressable switch from Analog Devices
Key Features
Thumbwheel switch with ten positions, state changes capture individually, durable device with over 25000 of steps, notch pointing to a starting wheel position, crown with small incisions for better finger traction, and more
Interface
1-Wire,GPIO
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Thumbwheel Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
– | PWR | – | Power LED Indicator |
– | VCC SEL | Left | Power Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
– | GP SEL | Right | General Purpose 1-Wire Selection OW0/OW1: Left position OW0, Right position OW1 |
Thumbwheel Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Software Support
We provide a library for the Thumbwheel Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Thumbwheel Click driver.
Key functions
thumbwheel_get_position
This function gets the position of the rotary sprocket.
Example Description
This example demonstrates the use of Thumbwheel click board by displaying the exact position of the rotary sprocket.
void application_task ( void )
{
static uint8_t old_position = 0xFF;
uint8_t position;
if ( ( THUMBWHEEL_OK == thumbwheel_get_position ( &thumbwheel, &position ) ) &&
( old_position != position ) )
{
log_printf( &logger, " Position: %u rnn", ( uint16_t ) position );
old_position = position;
}
Delay_ms( 100 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Thumbwheel
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 MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE 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.