B4J Question Raspberry Pi I2c Problem

Michael1968

Active Member
Licensed User
Longtime User
Hi all,

I spend the last weekend to get some i2c devices working on the Raspberry Pi

I used Erels example Code to access I2C API (pi4j) but it failed.

The Initialize seem to be OK ,because i get no error but i get no data from the devices.

I use MCP23017,ADS1015,PCF8574.
With python everything works fine.

thank you for your help

ps piface is working perfect

best regards

Michael
 
PCF8574 now work... was a wire problem,:(

Code: Copy
Dim bus As JavaObject = GetBus(1)
Dim device As JavaObject = GetDevice(bus, 0x24)

'-------pcf8574-------schreiben/lesen-----
Dim buffer(1) As Byte
Dim Int_Byte As Int

Write(device, 203)

Read2(device,buffer,0,1)
Int_Byte = Bit.AND(0xff, buffer(0))
Log (Bit.ToBinaryString(Int_Byte))

best regards

Michael
 
Upvote 0
Back
Top