I2C Over Pi

edited July 2017 in Raspberry PI

i am using a PN532 (NFC read/write) , connected to the Raspberry Pi over the I2C ports (SCL to 28, SDA to 27). When using the build in library of I2C, it does not find any I2C devices connected (writes nothing). I am new to I2C (and specially NFC), but I have learned that to write/read, it needs to be in 7-bit format (with an 8th bit being read or write), but I do not know if it can be extended (I need to write to 4Kb tags), and if I can manually perform the operations with a home-made library.

I got my code from https://processing.org/reference/libraries/io/I2C_list_.html .What I do not get, is why you cannot just super simply define the SCL and SDA ports.

I also tried writing ( https://processing.org/reference/libraries/io/I2C_write_.html ). But the initialized list is at an error with a size of '0', which I do not know if it can or should be larger...



  • @grimofdoom Feel free to post your I2C code so that we can have a look. The IO library comes with some I2C examples that could be informative (e.g. I2CCompass).

    You can double-check your wiring by running i2cdetect -y 1 in a terminal. The address of the PN532 need to show up there.

  • I know the question was asked long time ago, I managed to fixed an I²C issue yesterday after a long time period of failing. I just had to deactivate/reactivate I²C in RPI settings. No I²C device showed up in i2cdetect before, but after de/reactivating it is working now. Maybe my answer helps someone.

Sign In or Register to comment.