TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 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 (136815 times)
  2. FAT32 Library (69983 times)
  3. Network Ethernet Library (55952 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41892 times)
  6. FT800 Library (41198 times)
  7. GSM click (28990 times)
  8. PID Library (26420 times)
  9. mikroSDK (26376 times)
  10. microSD click (25383 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: 3998 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

Menus

5

Menu machine capable of handling text based menus. It only handles the logical behaviour of the menu(s), not their physical appearance e.g. on an LCD: the using project should still define the display or drawing procedures.

[Learn More]

OW_Utilities for PIC32

5

This library provides the basic one-wire search ROM and search ALARM routines, e.g. for the DS1820, the DS18S20 and the DS18B20.

[Learn More]

Tool: PIC Oscillator configuration and initialisation code generator

5

This tool helps, starting from the PIC18 or PIC24 oscillator block diagram, to define the oscillator related configuration settings and initialisation code. Only a limited number of PIC's is supported so far.

[Learn More]