sparkfun / SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

VL6180 Baby Bear time of flight range finder Library for use with SparkFun breakouts
Other
16 stars 16 forks source link

Is there a tutorial on how to make this lib work with the ESP8266 programmed in Arduino? #2

Closed lazyzero closed 2 years ago

lazyzero commented 8 years ago

I tested the lib with an Uno and it worked like a charme, but when attaching it to an NodeMCU V1 its not working.

I only get this:

ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1264, room 16 tail 0 chksum 0x42 csum 0x42 ~ld

lazyzero commented 8 years ago

Hello again,

I had again some time to dig into the problem of reboots using this lib.

Main Problem is that in the constructor:

VL6180x::VL6180x(uint8_t address)
// Initialize the Library
{
  Wire.begin(); // Arduino Wire library initializer
  _i2caddress = address; //set default address for communication
}

the Wire.begin() collides with the Wire.begin(D5,D6) in my main program, causing the resets. After deleting the Wire.begin in the lib everything was working as it should.

I guess it doesn't hurt in normal Adruino programmes if the begin is also done in the setup of the arduino program, as it is also done in your exsample.

So I propose to remove it from the library constructor.

Best Christian

ToniCorinne commented 8 years ago

Hi @lazyzero - if you want to submit a pull request with the changes you'd like to see, we can certainly take a look at those and determine if they would work for us to pull them into our libraries. Thanks!

nseidle commented 2 years ago

Super old but I was in the repo touching things up. This should be fixed with PR #3. Closing.