TOP Contributors

  1. MIKROE (2760 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139227 times)
  2. FAT32 Library (71732 times)
  3. Network Ethernet Library (57114 times)
  4. USB Device Library (47426 times)
  5. Network WiFi Library (43051 times)
  6. FT800 Library (42401 times)
  7. GSM click (29832 times)
  8. mikroSDK (28051 times)
  9. PID Library (26881 times)
  10. microSD click (26197 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: 4123 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]

TempSensors Ds1820 LM35

16

The basic functions for the DS18(S/B)20 (onewire digital temperature sensor), including string output, ready to display. A routine to convert a more than 9 bits temperature read from a DS18B20 to a string (to e.g. display on an LCD) is also present. Including Parasite Power and Configuration routines. The LM35 basic functions, code efficient.

[Learn More]

PS2 Keyboard Write Leds

5

Control the leds of a PS2 keyboard.

[Learn More]