Skip to main content

You are here

I2C PCF8574N and 4x3 Keypad

2 posts / 0 new
Last post
Mastershake
I2C PCF8574N and 4x3 Keypad

I got a free sample of a Texas Instruments PCF8574N I2C chip. I also bought a 4x3 flexible keypad from adafruit.com

There's a library on arduino.cc for using the PCF8574 and a 4x3 or 4x4 keypad. Only problem was I couldn't get the Jeelib I2C stuff to work in the library, either due to my ignorance and/or inexperience. I am recently new to arduino/jeenode's so my skill level is still fairly low.

I was able to port the library to a sketch and rewrite it for use with the the I2C stuff in Ports.h.

I do not know if I can use Ports.h in another library. Again, I'm still learning Arduino/C/C++ so I don't know for sure. So I don't know if I could have left it in a library and just called it in the sketch. I tried including Ports.h in the i2ckeypad.cpp library and change the necessary I2C specific functions but it would never compile right usually giving me about 25 different errors. I finally just put the code into a sketch and rewrote it from C++ to C to get rid of the library specific stuff.

Anyways. I successfully got it all to work and thought I would post it up incase anyone has/wants the PCF8574N since TI will send you free samples.

Original library: Arduino.cc\I2CkeypadLibrary

Modified Jeenode compatible sketch: Code link (Pastebin.com)

Questions/Comments/Criticisms welcome.

geenster1

Thanks for this one
I will try it out

I have an arduino library working on the jeenode it's called Keypad_I2C.

I am using the sda & scl pins
Works while you can also use the Jeelib.h library on the other 4 ports

Premium Drupal Themes by Adaptivethemes