SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

Post Reply
acronis
Posts: 143
Joined: Thu Mar 02, 2017 12:32 pm

SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

Post by acronis » Mon Jul 17, 2017 8:07 am

Hello.

Please help to adapt the library for the STM32F103.
https://github.com/sparkfun/SparkFun_To ... no_Library

Code: Select all

ERROR :


C:\Users\Admin\Documents\Arduino\libraries\SparkFun_ToF_Range_Finder-VL6180_Arduino_Library-master\src\SparkFun_VL6180X.cpp: In member function 'uint8_t VL6180x::VL6180x_getRegister(uint16_t)':

C:\Users\Admin\Documents\Arduino\libraries\SparkFun_ToF_Range_Finder-VL6180_Arduino_Library-master\src\SparkFun_VL6180X.cpp:201:29: error: no matching function for call to 'TwoWire::endTransmission(int)'

   Wire.endTransmission(false); //Send address and register address bytes

                             ^

C:\Users\Admin\Documents\Arduino\libraries\SparkFun_ToF_Range_Finder-VL6180_Arduino_Library-master\src\SparkFun_VL6180X.cpp:201:29: note: candidate is:

In file included from C:\Users\Admin\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire/Wire.h:43:0,

                 from C:\Users\Admin\Documents\Arduino\libraries\SparkFun_ToF_Range_Finder-VL6180_Arduino_Library-master\src\SparkFun_VL6180X.cpp:29:

C:\Users\Admin\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire/WireBase.h:93:11: note: uint8 WireBase::endTransmission()

     uint8 endTransmission(void);

           ^

C:\Users\Admin\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire/WireBase.h:93:11: note:   candidate expects 0 arguments, 1 provided

C:\Users\Admin\Documents\Arduino\libraries\SparkFun_ToF_Range_Finder-VL6180_Arduino_Library-master\src\SparkFun_VL6180X.cpp: In member function 'uint16_t VL6180x::VL6180x_getRegister16bit(uint16_t)':

C:\Users\Admin\Documents\Arduino\libraries\SparkFun_ToF_Range_Finder-VL6180_Arduino_Library-master\src\SparkFun_VL6180X.cpp:217:29: error: no matching function for call to 'TwoWire::endTransmission(int)'

   Wire.endTransmission(false); //Send address and register address bytes

                             ^

C:\Users\Admin\Documents\Arduino\libraries\SparkFun_ToF_Range_Finder-VL6180_Arduino_Library-master\src\SparkFun_VL6180X.cpp:217:29: note: candidate is:

In file included from C:\Users\Admin\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire/Wire.h:43:0,

                 from C:\Users\Admin\Documents\Arduino\libraries\SparkFun_ToF_Range_Finder-VL6180_Arduino_Library-master\src\SparkFun_VL6180X.cpp:29:

C:\Users\Admin\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire/WireBase.h:93:11: note: uint8 WireBase::endTransmission()

     uint8 endTransmission(void);

           ^

C:\Users\Admin\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire/WireBase.h:93:11: note:   candidate expects 0 arguments, 1 provided
Last edited by acronis on Mon Jul 17, 2017 12:51 pm, edited 1 time in total.

zmemw16
Posts: 1483
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

Post by zmemw16 » Mon Jul 17, 2017 12:38 pm

you're allowed to use spaces in the title :D
put the messages in a code box, it's scrollable and takes less visual space.
stephen

User avatar
RogerClark
Posts: 7422
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

Post by RogerClark » Mon Jul 17, 2017 9:47 pm

There is already another thread about this, where the OP said the Adafruit lib worked for them

zmemw16
Posts: 1483
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

Post by zmemw16 » Mon Jul 17, 2017 11:56 pm

thanks :)
stephen

acronis
Posts: 143
Joined: Thu Mar 02, 2017 12:32 pm

Re: SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

Post by acronis » Tue Jul 18, 2017 1:16 am

Adafruit lib works very slowly.
In this library the readings are changing very fast and I need it.

zmemw16
Posts: 1483
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

Post by zmemw16 » Tue Jul 18, 2017 2:12 am

toddled off to adafruit, found this
GPIO - this is a pin that is used by the sensor to indicate that data is ready. It's useful for when doing continuous sensing. Note there is no level shifting on this pin, you may not be able to read the 2.8V-logic-level voltage on a 5V microcontroller (we could on an arduino UNO but no promises). Our library doesn't make use of this pin but for advanced users, it's there!
might want to use that signal to trigger your i2c data reads ?

if using their example, there's a delay(50) in loop routine

stephen

acronis
Posts: 143
Joined: Thu Mar 02, 2017 12:32 pm

Re: SparkFun_ToF_Range_Finder-VL6180_Arduino_Library

Post by acronis » Tue Jul 18, 2017 2:33 am

All the latency (delay) from the project deleted !
The Adafruit library works fine - but data gets slow, and I these values must be averaged, the readings jump.
But the SparkFun library is very fast and allows you to connect through the multiplexer, several sensors to one controller.
With the Adafruit library, you can connect only one sensor.

I use the sensor SparkFun ToF Range Finder Breakout - VL6180
https://www.sparkfun.com/products/12784

Post Reply