Arduino no matching function for call to 'TwoWire::TwoWire()'

Hello,

I am trying to compile and flash an I2C Temperature sensor to Arduino MKR1000 and Nano33IoT and i Get an error as above.

I can compile and flash the code in a normal Arduino Uno and it works fine. Just for the MKR1000 and Nano33IoT it is giving an error.

Please see below and advise.

/home/builder/opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware /home/builder/opt/arduino-builder/hardware -hardware /home/builder/.arduino15/packages -tools /home/builder/opt/arduino-builder/tools -tools /home/builder/.arduino15/packages -built-in-libraries /home/builder/opt/libraries/latest -logger humantags -fqbn arduino:samd:mkr1000 -build-cache /tmp -build-path /tmp/483655470/build -verbose -prefs runtime.tools.CMSIS.path=/home/builder/.arduino15/packages/arduino/tools/CMSIS/4.5.0 -prefs runtime.tools.CMSIS-Atmel.path=/home/builder/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0 -prefs runtime.tools.arduinoOTA.path=/home/builder/.arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs runtime.tools.arm-none-eabi-gcc.path=/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4 -prefs runtime.tools.bossac.path=/home/builder/.arduino15/packages/arduino/tools/bossac/1.7.0-arduino3 -prefs runtime.tools.openocd.path=/home/builder/.arduino15/packages/arduino/tools/openocd/0.10.0-arduino7 -prefs runtime.tools.flashpack.path=/home/builder/.arduino15/packages/Intel/tools/flashpack/2.0.0 -prefs runtime.tools.arc-elf32.path=/home/builder/.arduino15/packages/Intel/tools/arc-elf32/1.6.9+1.0.1 -prefs runtime.tools.nrf5x-cl-tools.path=/home/builder/.arduino15/packages/arduino/tools/nrf5x-cl-tools/9.3.1 -prefs runtime.tools.arm-linux-gcc.path=/home/builder/.arduino15/packages/arduino/tools/arm-linux-gcc/4.9.3 -prefs runtime.tools.dfu-util.path=/home/builder/.arduino15/packages/arduino/tools/dfu-util/0.9.0-arduino1 -prefs runtime.tools.arduino101load.path=/home/builder/.arduino15/packages/Intel/tools/arduino101load/2.0.1 -prefs runtime.tools.sketchUploader.path=/home/builder/.arduino15/packages/Intel/tools/sketchUploader/1.6.2+1.0 -prefs runtime.tools.x86-linux-gcc.path=/home/builder/.arduino15/packages/arduino/tools/x86-linux-gcc/7.2.0 -prefs runtime.tools.esptool.path=/home/builder/.arduino15/packages/esp8266/tools/esptool/2.5.0-3-20ed2b9 -prefs runtime.tools.xtensa-lx106-elf-gcc.path=/home/builder/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9 -prefs runtime.tools.core2-32-poky-linux.path=/home/builder/.arduino15/packages/Intel/tools/core2-32-poky-linux/1.6.2+1.0 -prefs runtime.tools.i586-poky-linux-uclibc.path=/home/builder/.arduino15/packages/Intel/tools/i586-poky-linux-uclibc/1.6.2+1.0 -prefs runtime.tools.avrdude.path=/home/builder/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino8 -prefs runtime.tools.avr-gcc.path=/home/builder/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5 -prefs runtime.tools.linuxuploader.path=/home/builder/.arduino15/packages/arduino/tools/linuxuploader/1.5.1 -prefs runtime.tools.mkspiffs.path=/home/builder/.arduino15/packages/esp8266/tools/mkspiffs/2.5.0-3-20ed2b9 -libraries /tmp/483655470/custom -libraries /tmp/483655470/pinned /tmp/483655470/H206_Temp_apr28a

Using library arduinoeccx08_1_3_3 at version 1.3.3 in folder: /home/builder/opt/libraries/latest/arduinoeccx08_1_3_3

Using library SPI at version 1.0 in folder: /home/builder/.arduino15/packages/arduino/hardware/samd/1.8.4/libraries/SPI

/home/builder/opt/libraries/latest/grove_barometer_hp20x_1_0_0/HP20x_dev.cpp: In constructor 'HP20x_dev::HP20x_dev()':

/home/builder/opt/libraries/latest/grove_barometer_hp20x_1_0_0/HP20x_dev.cpp:33:22: error: no matching function for call to 'TwoWire::TwoWire()'

HP20x_dev::HP20x_dev()

^

In file included from /home/builder/opt/libraries/latest/grove_barometer_hp20x_1_0_0/HP20x_dev.h:14:0,

from /home/builder/opt/libraries/latest/grove_barometer_hp20x_1_0_0/HP20x_dev.cpp:13:

/home/builder/.arduino15/packages/arduino/hardware/samd/1.8.4/libraries/Wire/Wire.h:35:5: note: candidate: TwoWire::TwoWire(SERCOM*, uint8_t, uint8_t)

TwoWire(SERCOM *s, uint8_t pinSDA, uint8_t pinSCL);

^~~~~~~

/home/builder/.arduino15/packages/arduino/hardware/samd/1.8.4/libraries/Wire/Wire.h:35:5: note: candidate expects 3 arguments, 0 provided

/home/builder/.arduino15/packages/arduino/hardware/samd/1.8.4/libraries/Wire/Wire.h:32:7: note: candidate: constexpr TwoWire::TwoWire(const TwoWire&)

class TwoWire : public Stream

^~~~~~~

/home/builder/.arduino15/packages/arduino/hardware/samd/1.8.4/libraries/Wire/Wire.h:32:7: note: candidate expects 1 argument, 0 provided

/home/builder/.arduino15/packages/arduino/hardware/samd/1.8.4/libraries/Wire/Wire.h:32:7: note: candidate: constexpr TwoWire::TwoWire(TwoWire&&)

/home/builder/.arduino15/packages/arduino/hardware/samd/1.8.4/libraries/Wire/Wire.h:32:7: note: candidate expects 1 argument, 0 provided

exit status 1

You need to do some research about how to use the Wire library on SAMD boards. From the candidates, I'm guessing that SAMD boards do not have dedicated I2C pins, so software I2C is necessary. You have assumed that the boards do have dedicated I2C pins, which makes me wonder where you connected the device.

Hi, This article by Adafruit may help.

https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports/overview

Tom.... :)