Hello,
I'm trying to communicate a raspberry pi 3 model B with ADS1115 through i2c communication,
but it is not working.
When I run an adafruit example in python, its works
perfectly.
Using and arduino Mega i can read what python example sends to ADS1115 and I tried to send the same commands with no success.
my B4J program always read a random value.
Can someone tell me where is the problem??
Thanks in advance.
Here is my actual code:
I'm trying to communicate a raspberry pi 3 model B with ADS1115 through i2c communication,
but it is not working.
When I run an adafruit example in python, its works
perfectly.
Using and arduino Mega i can read what python example sends to ADS1115 and I tried to send the same commands with no success.
my B4J program always read a random value.
Can someone tell me where is the problem??
Thanks in advance.
Here is my actual code:
B4X:
Sub Button1_MouseClicked (EventData As MouseEvent)
Dim bus As JavaObject = GetBus(1)
Dim device As JavaObject = GetDevice(bus, 0x48)
Write(device, 0x90)
Write(device, 0x01)
Write(device, 0x84)
Write(device, 0x83)
Write(device, 0x90)
Write(device, 0x00)
Write(device, 0x91)
Sleep(100)
Dim buffer(2) As Byte
Dim len As Int = Read2(device, buffer, 0, buffer.Length)
Label1.Text = ""
For i = 0 To (len - 1)
Label1.Text = Label1.Text & buffer(i)
Next
End Sub
Last edited: