B4R Question Anyone wrap something from this site ? https://www.i2cdevlib.com/

KiloBravo

Active Member
Licensed User
Has anyone wrapped a lib from that site ? If you did a link would be appreciated. If not I have been brushing up on my C++ and reading Erel's posts on the subject. Wrapping always seems to make sense to me. Then I go to wrap one and there always seems to be something different that I don't know how to handle. LOL.
Anyway I think I will try and wrap the ADS115 as time permits. The site has a working Arduino Code example.
If that proves to difficult I may look for an easier example on that Git Hub site to start with. :)

https://www.i2cdevlib.com/docs/html/class_a_d_s1115.html <<< This is cool. Kind of like the B4X Object Browser but online.

Seems like it was a great idea. I am not sure the site is still very active and being updated. A lot of features seem to be not fully implemeted or in a future dev state.
But what is on there looks pretty good for Arduino and I2C.
 

thetahsk

Active Member
Licensed User
Longtime User
The work has already been implemented. Try to port the Adafruit lib to B4R.
B4X:
#include <Wire.h>
#include <Adafruit_ADS1015.h>

Adafruit_ADS1115 ads;

.....
 
Upvote 0

KiloBravo

Active Member
Licensed User
I never got back to this, because I switched from an ESP8266 to an ESP32 for BlueTooth. The ADC on the ESP32 worked fine for reading the KY-023 Joystick values. Although those joysticks are not the best for fine control. They tend to jump high or low and also Max out at half the range of movement as others have noted. I was able to smooth out the motor control in my app by using a timer in the B4R code. I read the values directly and then only moved the motor power up or down slowly on each timer loop.
 
Upvote 0
Top