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
 

Michael1968

Active Member
Licensed User
Longtime User
PCF8574 now work... was a wire problem,:(

B4X:
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

Michael1968

Active Member
Licensed User
Longtime User
Hi,

atteched my first GUI-Programm to test (read/write) PCF8574 with Raspberry Pi

best regards
Michael
 

Attachments

  • pcf8574_1.zip
    2.2 KB · Views: 318
Upvote 0
Top