pololu / vl53l0x-arduino

Pololu Arduino library for VL53L0X time-of-flight distance sensor
https://www.pololu.com/product/2490
Other
346 stars 162 forks source link

Getting below compilation errors when try to run examples #56

Closed ravigunasekara closed 2 years ago

ravigunasekara commented 2 years ago

Am using Version 1.3.0 with Raspberry Pi Pico

/Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp: In member function 'void VL53L0X::writeReg32Bit(uint8_t, uint32_t)':
/Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp:309:34: error: call of overloaded 'write(long unsigned int)' is ambiguous
   bus->write((value >> 24) & 0xFF); // value highest byte
                                  ^
In file included from /Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.h:5:0,
                 from /Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp:6:
/Users/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/2.8.0/libraries/Wire/Wire.h:59:20: note: candidate: virtual size_t arduino::MbedI2C::write(uint8_t)
     virtual size_t write(uint8_t data);
                    ^~~~~
/Users/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/2.8.0/libraries/Wire/Wire.h:60:20: note: candidate: virtual size_t arduino::MbedI2C::write(int)
     virtual size_t write(int data) {
                    ^~~~~
/Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp:310:34: error: call of overloaded 'write(long unsigned int)' is ambiguous
   bus->write((value >> 16) & 0xFF);
                                  ^
In file included from /Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.h:5:0,
                 from /Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp:6:
/Users/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/2.8.0/libraries/Wire/Wire.h:59:20: note: candidate: virtual size_t arduino::MbedI2C::write(uint8_t)
     virtual size_t write(uint8_t data);
                    ^~~~~
/Users/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/2.8.0/libraries/Wire/Wire.h:60:20: note: candidate: virtual size_t arduino::MbedI2C::write(int)
     virtual size_t write(int data) {
                    ^~~~~
/Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp:311:34: error: call of overloaded 'write(long unsigned int)' is ambiguous
   bus->write((value >>  8) & 0xFF);
                                  ^
In file included from /Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.h:5:0,
                 from /Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp:6:
/Users/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/2.8.0/libraries/Wire/Wire.h:59:20: note: candidate: virtual size_t arduino::MbedI2C::write(uint8_t)
     virtual size_t write(uint8_t data);
                    ^~~~~
/Users/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/2.8.0/libraries/Wire/Wire.h:60:20: note: candidate: virtual size_t arduino::MbedI2C::write(int)
     virtual size_t write(int data) {
                    ^~~~~
/Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp:312:34: error: call of overloaded 'write(long unsigned int)' is ambiguous
   bus->write( value        & 0xFF); // value lowest byte
                                  ^
In file included from /Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.h:5:0,
                 from /Users/Documents/Arduino/libraries/VL53L0X/VL53L0X.cpp:6:
/Users/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/2.8.0/libraries/Wire/Wire.h:59:20: note: candidate: virtual size_t arduino::MbedI2C::write(uint8_t)
     virtual size_t write(uint8_t data);
                    ^~~~~
/Users/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/2.8.0/libraries/Wire/Wire.h:60:20: note: candidate: virtual size_t arduino::MbedI2C::write(int)
     virtual size_t write(int data) {
                    ^~~~~
exit status 1
Error compiling for board Raspberry Pi Pico.
kevin-pololu commented 2 years ago

I just released a new version (1.3.1) that should allow the library to compile for the RP2040. Please let me know if you see any further issues that are related.