Thumbwheel click is a mikroBUS™ add-on board with a 10-position rotary sprocket connected to a 1-Wire 8-Channel Addressable Switch. The starting position of the switch is marked with a small notch on the PCB above the wheel. Printed numerals from 1 to 10 clearly mark each position. The thumbwheel has a crown with small incisions for better finger traction. The board can use both a 3.3V or a 5V power supply. The One-Wire signal can be sent either through the mikroBUS AN or PWM pins. You choose which one by soldering the GP SEL jumper into the right position.
Type | Port expander |
Applications | Used as a simple input device on a variety of instruments, machines, and similar devices |
On-board modules | DS2408 8-channel addressable switch |
Key Features | 1-Wire 8-Channel 10-position thumbwheel switch |
Key Benefits | Configurable output pin (OW1 or OW2), Starting point marked with notch on PCB for easier orientation |
Interface | GPIO |
Input Voltage | 3.3V or 5V |
Compatibility | mikroBUS |
Click board size | M (42.9 x 25.4 mm) |
The starting position of the switch is marked with a small notch on the PCB above the wheel. Printed numerals from 1 to 10 clearly mark each position. The thumbwheel has a crown with small incisions for better finger traction. The board can use both a 3.3V or a 5V power supply. The One-Wire signal can be sent either through the mikroBUS AN or PWM pins. You choose which one by soldering the GP SEL jumper into the right position.
Thumwheel click is controlled through a simple Dallas One-Wire protocol with only three functions. There is a function for configuring the registers, a function for reading the current position of the thumbwheel, and a function for software reset. Hardware reset can be executed using the RST pin.
MikroElektronika compilers contain a One-Wire library that works with this click.
The following code snippet reads the current position of the thumbwheel
1 char DS2408_ChannelRead() 2 { 3 int state; 4 5 while( Ow_Reset( &GPIOA_BASE, 0 ) ); 6 7 Ow_Write( &GPIOA_BASE, 0, DS2408_SKIP_ROM_CMD ); 8 Ow_Write( &GPIOA_BASE, 0, DS2408_CHANNEL_READ_CMD ); 9 state = Ow_Read( &GPIOA_BASE, 0 ); 10 return state; 11 }
Code examples that demonstrate the usage of Thumbwheel click with MikroElektronika hardware, written for mikroC, mikroBasic and mikroPascal for ARM, AVR, dsPIC, and PIC are available on [Libstock].