With Pi4J, I can communicate with I2C with Java. But is there any way I can communicate with I2C with Java, without Pi4J. Just by using Linux internal...shell-ish...command?
I want to read and write data.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
Implementation example available here: https://github.com/mattjlewis/diozero/tree/master/diozero-core/src/main/java/com/diozero/internal/provider/builtin/i2c Two versions, one via JNI, the other using a Java RandomAccessFile. Note that for the second Java implementation a small bit of C code is required to run an ioctl command to setup the file for I2C (I2C select slave).