TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139559 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47607 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42551 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26930 times)
  10. microSD click (26309 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

Keypad_I2c

Rating:

10

Author: dany

Last Updated: 2016-02-18

Package Version: 1.0.0.0

Category: Other Codes

Downloaded: 4146 times

Followed by: 1 user

License: MIT license  

Library for a 4x4 keypad connected to the PIC via an PCF8574 I2c expander (Two I2c lines in stead of 8 I/O pins). This saves a lot of PIC I/O pins.
Permits also small PIC's (with low pin count) to control a keypad.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Keypad_I2c" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Keypad_I2c" changes.

Do you want to report abuse regarding "Keypad_I2c".

  • Information
  • Comments (3)

Library Blog

"Keypad_I2c" is a library to connect an 4x4 keypad via I2c to the PIC, using a PCF8574 expander. It uses the PCF8574 library.

In contradiction with the 4x4 keypad library from mE (connection via 8 I/O pins to the PIC), this version does not require pull down resistors (the internal ones of the PCF8574 are used in stead).

The functionality is the same as that of the mE (parallel connections) library, plus one addition: the function Keypad_I2c_PCF8574_Key_Status. It returns 16 bits (one word) with the status of all keys in the keypad: Key1 = bit 0; Key2 = bit 1;...; Key16 = bit 15. A bit with the value "1" is pressed, "0" is not pressed.

Have fun!

----------------------------------------------------------------------------------------------------------------------------------------------

2013-03-18: original version.

Connection diagram

Connection diagram

Connection Diagram for a 4x4 keypad. If there are less keypad columns or rows, then the free PCF8574 line(s) should be left unconnected.

View full image

-----------------------------------------------------------------------------------------------------------------------------------------------
2013-03-19: added the function Keypad_I2c_PCF8574_Key_Status.
It returns 16 bits (one word) with the status of all keys in the keypad:
Key1 = bit 0; Key2 = bit 1;...; Key16 = bit 15.
A bit with the value "1" is pressed, "0" is not pressed

-----------------------------------------------------------------------------------------------------------------------------------------------

2013-03-21: removed an omission in the example for the Keypad_I2c library: the call to "Soft_I2c_Init" was forgotten (still, it worked!).

---------------------------------------------------------------------------------------------------------------------------------------------
2013-03-25: Replaced the mikroBasic package files. The target compiler in them was still mikroPascal. Sorry for the inconvenience.

----------------------------------------------------------------------------------------------------------------------------------------

2014-03-13: The mikroBasic files and zip files have been updated. All mB sources are present now (not tested if compilable though).


2015-01-26: Replaced the mB files: all mB files are compilable now (which e.g. means that all "with" statements are dealt with). I could however not link and test the libraries (no mB licence).

ALSO FROM THIS AUTHOR

USB-HID dll for Delphi (and perhaps other languages)

5

Two versions of an USB-HID dll, meant for PC (Delphi, etc...) usage:
A basic version, developed by Joop Beunders,
A somewhat more extended version, based on the basic version of Joop.

[Learn More]

Tool: mikroPascal to mikroBasic convertor

10

Simple mikroPascal for PIC to mikroBasic for PIC source code convertor. The tool can convert complete mP units to mB modules and complete mP programs to mB programs. It can be used both in interactive and batchmode.

[Learn More]

Wifi Plus click HTTP Client

0

With this example one can load an internet page from an HTTP server. At this moment the remote IP address is fixed in the code and it loads the default file from the server. All data received from the HTTP server is sent to Uart1 where it can be picked up by a uart program to display or to save to a file.

[Learn More]