JMB Active Member Licensed User Longtime User Apr 30, 2017 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User May 1, 2017 #2 Is there any Arduino example (C) that you can run to test that it is working? Upvote 0
rbghongade Well-Known Member Licensed User Longtime User May 1, 2017 #3 Have a look here: https://www.b4x.com/android/forum/posts/454972/ Upvote 0
JMB Active Member Licensed User Longtime User May 2, 2017 #4 Thanks guys, I will have a look at that Arduino code and see if I can get it working using that. Upvote 0