morind79
Posts: 27
Joined: Mon Oct 29, 2012 8:51 am

Pi4J and I2C

Tue Dec 11, 2012 2:04 pm

Hi all,

I have made a PCB with several things working with I2C, SPI and digital I/O.
I plan to use Pi4J which seems very good.
For normal digital I/O, no problem I can do what I need.
But for I2C and also SPI, I think I will need some code example.

For example I connected an I2C Lcd screen (2*16) through a PCA9517 volatge level translator.
I would like to create a library to drive this display, but really need some info to start.

Here is the schematic of what I did :
GPIO.zip
(31.49 KiB) Downloaded 475 times
So if some are interested, I can also give some explanation and Gerber X data.

Best regards,

Denis

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: Pi4J and I2C

Tue Dec 11, 2012 4:20 pm

Hi Denis,

The I2C implementation in Pi4J is pretty new but I did manage to use it successfully to create a I2C-based GpioProvider for the MCP23008 and MCP23017. This source may provide a starting example for you to look at.
https://github.com/Pi4J/pi4j/tree/maste ... ension/mcp
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

morind79
Posts: 27
Joined: Mon Oct 29, 2012 8:51 am

Re: Pi4J and I2C

Thu Dec 13, 2012 8:17 am

Hi Robert,

Thank you very much, this helped me a lot.
I am able to send some data to the I2C LCD screen using Pi4J now.

Best regards

Denis

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: Pi4J and I2C

Thu Dec 13, 2012 2:40 pm

Excellent! Thanks for the update.
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

smoogli
Posts: 3
Joined: Sun Sep 23, 2012 1:36 pm

Re: Pi4J and I2C

Mon Feb 11, 2013 4:35 pm

Hi folks,
what was connected over I2C? (picture of desk with RPI and the gizmo would be perfect :-)

cheers!

morind79
Posts: 27
Joined: Mon Oct 29, 2012 8:51 am

Re: Pi4J and I2C

Mon Feb 11, 2013 4:40 pm

Hi Smoogli,

The I2C module connected is a LCD screen (4 x 20 characters)
If you need more information, please have a look at www.raspext.com, I will add more on it as soon as I can.

Best regards

Denis

Return to “Other programming languages”