trying to use the updated i2c_t3 library instead of Arduino wire.h, so far not much luck:
Arduino: 1.8.9 (Linux), TD: 1.46, Board: "Teensy 3.6, Serial, 180 MHz, Faster, US English"
/tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o: In function `i2c0_isr':
/home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/WireKinetis.cpp:895: multiple definition of `i2c0_isr'
/tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o:/home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/i2c_t3/i2c_t3.cpp:1134: first defined here
/home/ralph/arduino-1.8.9/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
/tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o: In function `Print::availableForWrite()':
/home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/WireKinetis.h:132: multiple definition of `i2c1_isr'
/tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o:/home/ralph/arduino-1.8.9/hardware/teensy/avr/cores/teensy3/Print.h:61: first defined here
/tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o: In function `Print::availableForWrite()':
/home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/WireKinetis.h:132: multiple definition of `i2c2_isr'
/tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o:/home/ralph/arduino-1.8.9/hardware/teensy/avr/cores/teensy3/Print.h:61: first defined here
/tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o: In function `Print::availableForWrite()':
/home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/WireKinetis.h:132: multiple definition of `Wire2'
/tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o:/home/ralph/arduino-1.8.9/hardware/teensy/avr/cores/teensy3/Print.h:61: first defined here
/home/ralph/arduino-1.8.9/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Warning: size of symbol `Wire2' changed from 20 in /tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o to 108 in /tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o
/tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o: In function `Print::availableForWrite()':
/home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/WireKinetis.h:132: multiple definition of `Wire1'
/tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o:/home/ralph/arduino-1.8.9/hardware/teensy/avr/cores/teensy3/Print.h:61: first defined here
/home/ralph/arduino-1.8.9/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Warning: size of symbol `Wire1' changed from 20 in /tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o to 108 in /tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o
/tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o: In function `Print::availableForWrite()':
/home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/Wire/WireKinetis.h:132: multiple definition of `Wire'
/tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o:/home/ralph/arduino-1.8.9/hardware/teensy/avr/cores/teensy3/Print.h:61: first defined here
/home/ralph/arduino-1.8.9/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Warning: size of symbol `Wire' changed from 20 in /tmp/arduino_build_957573/libraries/i2c_t3/i2c_t3.cpp.o to 108 in /tmp/arduino_build_957573/libraries/Wire/WireKinetis.cpp.o
collect2: error: ld returned 1 exit status
Error compiling for board Teensy 3.6.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
verbose option showed:
Using library i2c_t3 in folder: /home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/i2c_t3 (legacy)
Using library VL53L1X at version 1.0.1 in folder: /home/ralph/code/libraries/VL53L1X
Using library Wire at version 1.0 in folder: /home/ralph/arduino-1.8.9/hardware/teensy/avr/libraries/Wire
not sure why Wire is being used, not in the code as far as I can tell:
/*
for Teensy 3.6
This example takes range measurements with the VL53L1X and displays additional
details (status and signal/ambient rates) for each measurement, which can help
you determine whether the sensor is operating normally and the reported range is
valid. The range is in units of mm, and the rates are in units of MCPS (mega
counts per second).
*/
//#include <Wire.h> // Arduino Wire Library
#include <i2c_t3.h> // Teensy I2C lib at
https://github.com/nox771/i2c_t3
//default pin setting SCL/SDA:
//- Wire: 19/18
//- Wire1: 37/38 (3.5/3.6)
//- Wire2: 3/4 (3.5/3.6)
//- Wire3: 57/56 (3.6)
#include <VL53L1X.h>
VL53L1X sensor;
void setup()
{
Serial.begin(115200);
delay(250);
Wire2.begin();
Wire2.setClock(400000); // use 400 kHz I2C
sensor.setTimeout(500);
if (!sensor.init())
{
Serial.println("Failed to detect and initialize sensor!");
while (1);
}
// Use long distance mode and allow up to 50000 us (50 ms) for a measurement.
// You can change these settings to adjust the performance of the sensor, but
// the minimum timing budget is 20 ms for short distance mode and 33 ms for
// medium and long distance modes. See the VL53L1X datasheet for more
// information on range and timing limits.
sensor.setDistanceMode(VL53L1X::Long);
sensor.setMeasurementTimingBudget(50000);
// Start continuous readings at a rate of one measurement every 50 ms (the
// inter-measurement period). This period should be at least as long as the
// timing budget.
sensor.startContinuous(50);
}
void loop()
{
sensor.read();
Serial.print("range: ");
Serial.print(sensor.ranging_data.range_mm);
Serial.print("\tstatus: ");
Serial.print(VL53L1X::rangeStatusToString(sensor.ranging_data.range_status));
Serial.print("\tpeak signal: ");
Serial.print(sensor.ranging_data.peak_signal_count_rate_MCPS);
Serial.print("\tambient: ");
Serial.print(sensor.ranging_data.ambient_count_rate_MCPS);
Serial.println();
}