mLink 6 Button Pad (HCMODU0193)

mLink serial I2C modules
Post Reply
admin
Site Admin
Posts: 866
Joined: Sun Aug 05, 2012 4:02 pm

mLink 6 Button Pad (HCMODU0193)

Post by admin » Wed Aug 17, 2022 9:04 am

Image





The mLink button pad is a 6 button keypad with a serial (I2C) interface. The buttons are arranged in a d-pad format (up, down, left, right, plus select and back buttons). They have a tactile feedback when pressed and come with large (11mm) coloured circular keycaps that also make the module ideal for panel mounting. The module can also store up to 16 key presses in its internal buffer meaning that your software does not have to constantly scan the keypad to capture keypresses.

Because it uses a standard I2C interface it is compatible with most microcontrollers including Arduino. It is addressable allowing for multiple modules to be connected together (address can be changed in software), and only requires 2 data pins for communication.

Being an mLink module it is compatible with other mLink or standard I2C modules allowing you to daisy-chain several different types of modules together using only the two I2C pins of your microcontroller.


For Arduino users you can use the mLink library (see below) to control any type of mLink module. The library has a very small memory footprint and only one single instance is needed to control multiple types of mLink modules. This makes it great for Arduinos with small amounts of memory and pin counts.

For Raspberry Pi users we have a Python module which can be installed via pip or downloaded and installed directly from our forum. Please see the mLink Python forum thread for requirements and download link here: viewtopic.php?f=131&t=3062&p=8592#p8592



Module specifications:

Module code: 					HCMODU0193
Supply voltage (VDD): 			3.3V to 5.5V
Operating range (recommended):	-5 to 105oC
Keypad type:					6 button tactile keypad in dpad + back arrangement
Current consumption (idle):		4.5mA
Interfaces:					I2C, Keypad
I2C Interface speed: 				400kbits/s (fast mode)
I2C default address (HEX): 		0h59
Maximum number of modules: 		5 with pullups fitted, 112 with pullups removed*
Module dimensions (inc headers):	59mm x 44mm x 16mm



*Note the maximum number of connected modules will depend on cable lengths and power requirements of each module. Do not exceed 5 mLink modules connected in series with all pullups fitted.



Arduino Connection Example:

Image


Image

Because the modules use an I2C interface this also means multiple modules can be controlled from a single Arduino I2C interface simply by daisy-chaining them together. Note to control multiple mLink modules of the same type requires changing the default I2C address of the additional modules. See mLink Library Quick Start Guide for how to do this.


Image



Arduino example:

  1. #include "mLink.h"                                    // Include the library
  2.  
  3. mLink mLink;                                          // Create an instance of the library
  4.  
  5. #define I2C_ADD BPAD_I2C_ADD                          // Default I2C address
  6.  
  7. void setup()
  8. {
  9.   Serial.begin(9600);
  10.  
  11.   mLink.init();                                       // Initialise the library
  12. }
  13.  
  14.  
  15. void loop()
  16. {  
  17.   byte empty = mLink.bPad_Empty(I2C_ADD);             // Check to see if there is anything in the keypad buffer
  18.  
  19.   if(!empty)                                          
  20.   {
  21.     byte key = mLink.read(I2C_ADD, BPAD_BUFFER);      // If so then read a key from the buffer..
  22.  
  23.     Serial.print("Key: ");                            // ..and print it                          
  24.     Serial.println(key);
  25.   }
  26.  
  27.   delay(100);
  28. }



Arduino Connection Example:

Image




Raspberry Pi Python Example:

This program requires the mLink Python library module to be installed. Please see the following forum thread for more information on how to install the Python module and requirements:

viewtopic.php?f=131&t=3062

  1. from mLink import mLink                     # Import the mLink module
  2. import time
  3.  
  4. ml = mLink.mLink(1)                         # Create an instance of the module
  5.  
  6. I2C_ADD = 0x59                              # Default I2C address is 0x59
  7.  
  8.  
  9. while 1:
  10.     if ml.bPad_New_Key(I2C_ADD):            # Check if a key has been pressed
  11.         print(ml.bPad_Read_Key(I2C_ADD))    # If so print its name
  12.     time.sleep(0.1)



Image

mLink Arduino library
viewtopic.php?f=58&t=3001


mLink Raspberry Pi Python module
The mLink python module can be installed with the following terminal command:

  1. pip install hc-mlink

Alternatively the library can be manually installed by downloading it from the forum and unzipping it to your project folder. See the Python module forum thread for more information and download link:
viewtopic.php?f=131&t=3062&p=8592#p8592

Please note that in some cases there may be additional configuration required. If you have issues getting your Raspberry Pi to communicate with the mLink module then please see the Python module forum thread here: viewtopic.php?f=131&t=3062


mLink Library Quick Start Guide For Arduino Users
https://hobbycomponents.com/downloads/m ... _Guide.pdf


mLink Library Reference Guide For The Character LCD Sensor Modules
https://hobbycomponents.com/downloads/m ... _Guide.pdf


mLink Specifications and Register Map For The Character LCD Modules
https://hobbycomponents.com/downloads/m ... er_Map.pdf


Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do no provide any guarantees or warranties as to their accuracy or fitness for purpose.

Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.

steve001
Posts: 37
Joined: Tue Dec 30, 2014 3:27 pm

Re: mLink 6 Button Pad (HCMODU0193)

Post by steve001 » Sun Apr 09, 2023 1:29 pm

Hi

The Link(s) above are giving a 403 error "don't have permission on this server"

Regards

Steve

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: mLink 6 Button Pad (HCMODU0193)

Post by andrew » Mon Apr 10, 2023 8:08 am

The Link(s) above are giving a 403 error "don't have permission on this server"
Sorry about that, it should be fixed now.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

steve001
Posts: 37
Joined: Tue Dec 30, 2014 3:27 pm

Re: mLink 6 Button Pad (HCMODU0193)

Post by steve001 » Mon Apr 10, 2023 2:47 pm

Brilliant Thank you

steve001
Posts: 37
Joined: Tue Dec 30, 2014 3:27 pm

Re: mLink 6 Button Pad (HCMODU0193)

Post by steve001 » Tue Apr 11, 2023 11:41 am

Is there a circuit diagram for this module please

Thank you in advance

Steve

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: mLink 6 Button Pad (HCMODU0193)

Post by andrew » Mon Apr 17, 2023 10:23 am

@Steve
Sorry for missing your post, just to let you know I've replied to your email.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “mLink”