B4R Question ADS1115, NodeMCU and the I2C bus

JMB

Active Member
Licensed User
Longtime User
HI

I am trying to control an ADS1115 ADC board from a NodeMCU ESP8266 board.

I have connected everything up correctly, but I am not getting data out of the ADS1115.

I am using the rWire library as I understand that that is the I2C equivalent for B4R.

Do the rWire calls take care of all the handshaking that appears to go on with the I2C bus?

I am still getting my head round the whole I2C protocol.

The core of my code is this:

B4X:
    master.Initialize
    master.WriteTo2(SLAVE_ADDRESS,True, Array As Byte(0x01))    'Point to the Configuration Register
    master.WriteTo2(SLAVE_ADDRESS,True, Array As Byte(0xc2))    'Hi 8 bits - continuous mode , single ended input, A0
    master.WriteTo2(SLAVE_ADDRESS,True, Array As Byte(0xe3))    'Lo 8 bits

and to get the result, I do:

B4X:
    master.WriteTo(SLAVE_ADDRESS, Array As Byte(0x00))
    Dim b() As Byte = master.RequestFrom(SLAVE_ADDRESS, 2)

I appear to have all the connections correct between the two chips.

Thank you for your help.

JMB
 

JMB

Active Member
Licensed User
Longtime User
Thanks guys, I will have a look at that Arduino code and see if I can get it working using that.
 
Upvote 0
Top