TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 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 (136652 times)
  2. FAT32 Library (69870 times)
  3. Network Ethernet Library (55902 times)
  4. USB Device Library (46245 times)
  5. Network WiFi Library (41871 times)
  6. FT800 Library (41113 times)
  7. GSM click (28966 times)
  8. PID Library (26403 times)
  9. mikroSDK (26330 times)
  10. microSD click (25344 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: 3994 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

Telnet to RS232

5

This device (hard and software) can be used to control up to 6 RS232 devices via Telnet (Ethernet). Uses the Ethernet ENC library v3_5 from Yo2Lio.

[Learn More]

AC Dimmer, 230V

0

Simple galvanic isolated dimmer (with triac phase control) for 230V AC.

[Learn More]

Thermostat with DS1820

5

Usage of the Ds1820 (one wire temp sensor) to control a heating system. Provides 2 different temp settings (e.g. day and night settings). Proportional control of the heater (which is basically on/off controlled) using PWM like method with a 1 minute timebase (x minutes on, y minutes off).

[Learn More]