Skip to content

Sensors on different I2C channels #39

@TorbenSchreiter

Description

@TorbenSchreiter

Hi there,

for an ESP32-based project, we needed a way to distribute sensors on the two separate hardware wires (Wire. and Wire1.). The modified version of the lib is attached (VL53L0X-2xI2C.zip).

@kevin-pololu Changes are straight forward. Would be great if this could be integrated into the master branch at some point.

How to use:

#include <Wire.h>
#include "VL53L0X-2xI2C.h"

VL53L0X sensor;
VL53L0X sensor2;

Wire.begin(GPIOSDA,GPIOSCL); // initialize I2C w/ I2C pins from config
present = sensor.init(true, &Wire);

Wire1.begin(GPIOSDA2,GPIOSCL2); // initialize I2C w/ I2C pins from config
present2 = sensor2.init(true, &Wire1);

Cheers,
Torben

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions