vl53l0x与Android的东西

时间:2018-10-16 02:33:21

标签: raspberry-pi android-things

我希望在树莓派3 b +中将VL53L0X与android Things一起使用

private static final String I2C_DEVICE_NAME = "I2C1";
private static final int I2C_ADDRESS = 0x52;
    PeripheralManager manager = PeripheralManager.getInstance();

    List<String> deviceList = manager.getI2cBusList();
    if (deviceList.isEmpty()) {
        Log.i(TAG, "No I2C bus available on this device.");
    } else {
        Log.i(TAG, "List of available devices: " + deviceList);
    }
    byte b=0;
    //i2c연결
    try {
        mDevice = manager.openI2cDevice(I2C_DEVICE_NAME, I2C_ADDRESS);

        String name= mDevice.getName();
        Log.w(TAG, "connected"+name);

此代码将i2c连接的Android事物VL53L0X连接起来

但是我听不懂读取的距离数据

0 个答案:

没有答案