Pro Microによる距離センサーモジュール「 VL53L0X」での計測」で使用した距離センサーモジュール「 VL53L0X」で、今回はRaspberry Pi Zero WHによりGO言語を用いて距離を計測します。

Raspberry Pi Zero WHと距離センサーモジュール「 VL53L0X」の接続

今回使用した距離センサーモジュール「 VL53L0X」の信号を次のようにRaspberry Pi Zero WHに接続します。

Raspberry Pi Zero WHと距離センサーモジュール「 VL53L0X」の接続
Raspberry Pi Zero WH 距離センサーモジュール「 VL53L0X」
GND GND
3V3 VCC
GPIO03 SCL
GPIO02 SDA

次のコマンドで接続した距離センサーモジュール「 VL53L0X」のI2Cアドレスを確認します。I2Cアドレスは「29」になっていました。

$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Raspberry Pi Zero WHと距離センサーモジュール「 VL53L0X」との接続画像を次に示します。

使用する距離センサーモジュール「 VL53L0X」ライブラリのインストール

次のコマンドで距離センサーモジュール「 VL53L0X」ライブラリをインストールします。

$ go get -u github.com/d2r2/go-vl53l0x

距離センサーアプリの作成

距離センサーアプリを次に示します。「d2r2/go-vl53l0x」のGolang usageを参照してください。

govl53l0x.go

package main

import (
	"log"
	
	"github.com/d2r2/go-i2c"
	"github.com/d2r2/go-vl53l0x"
)

func main() {
    // Create new connection to i2c-bus on 0 line with address 0x29.
    // Use i2cdetect utility to find device address over the i2c-bus
    i2c, err := i2c.NewI2C(0x29, 1)
    if err != nil {
        log.Fatal(err)
    }
    defer i2c.Close()

    sensor := vl53l0x.NewVl53l0x()
    // It's highly recommended to reset sensor each time before repeated initialization.
    err = sensor.Reset(i2c)
    if err != nil {
        log.Fatal(err)
    }
    // By default, sensor initialized with "RegularRange" and "RegularAccuracy" parameters.
    err = sensor.Init(i2c)
    if err != nil {
        log.Fatal(err)
    }
    rng, err := sensor.ReadRangeSingleMillimeters(i2c)
    if err != nil {
        log.Fatal(err)
    }
    log.Printf("Measured range = %v mm", rng)
}

距離センサーアプリの実行

次のコマンドでコンパイルして実行します。最後に表示される「Measured range 」で「201 mm」と測定されました。

$ go build
$ ./govl53l0x
2021-05-14T14:40:49.571 [ vl53l0x] DEBUG  Set reset bit
2021-05-14T14:40:49.576 [     i2c] DEBUG  Write 2 hex bytes: [bf00]
2021-05-14T14:40:49.580 [     i2c] DEBUG  Write U8 0 to reg 0xBF
2021-05-14T14:40:49.584 [     i2c] DEBUG  Write 1 hex bytes: [c0]
2021-05-14T14:40:49.588 [     i2c] DEBUG  Read 1 hex bytes: [00]
2021-05-14T14:40:49.592 [     i2c] DEBUG  Read U8 0 from reg 0xC0
2021-05-14T14:40:49.596 [ vl53l0x] DEBUG  Release reset bit
2021-05-14T14:40:49.599 [     i2c] DEBUG  Write 2 hex bytes: [bf01]
2021-05-14T14:40:49.603 [     i2c] DEBUG  Write U8 1 to reg 0xBF
2021-05-14T14:40:49.606 [     i2c] DEBUG  Write 1 hex bytes: [c0]
2021-05-14T14:40:49.610 [     i2c] DEBUG  Read 1 hex bytes: [ee]
2021-05-14T14:40:49.613 [     i2c] DEBUG  Read U8 238 from reg 0xC0
2021-05-14T14:40:49.617 [     i2c] DEBUG  Write 2 hex bytes: [8800]
2021-05-14T14:40:49.620 [     i2c] DEBUG  Write U8 0 to reg 0x88
2021-05-14T14:40:49.624 [     i2c] DEBUG  Write 2 hex bytes: [8001]
2021-05-14T14:40:49.627 [     i2c] DEBUG  Write U8 1 to reg 0x80
2021-05-14T14:40:49.630 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:49.634 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:49.637 [     i2c] DEBUG  Write 2 hex bytes: [0000]
2021-05-14T14:40:49.640 [     i2c] DEBUG  Write U8 0 to reg 0x0
2021-05-14T14:40:49.643 [     i2c] DEBUG  Write 1 hex bytes: [91]
2021-05-14T14:40:49.648 [     i2c] DEBUG  Read 1 hex bytes: [3c]
2021-05-14T14:40:49.651 [     i2c] DEBUG  Read U8 60 from reg 0x91
2021-05-14T14:40:49.655 [     i2c] DEBUG  Write 2 hex bytes: [0001]
2021-05-14T14:40:49.659 [     i2c] DEBUG  Write U8 1 to reg 0x0
2021-05-14T14:40:49.662 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:49.666 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:49.669 [     i2c] DEBUG  Write 2 hex bytes: [8000]
2021-05-14T14:40:49.673 [     i2c] DEBUG  Write U8 0 to reg 0x80
2021-05-14T14:40:49.676 [     i2c] DEBUG  Write 1 hex bytes: [60]
2021-05-14T14:40:49.680 [     i2c] DEBUG  Read 1 hex bytes: [00]
2021-05-14T14:40:49.684 [     i2c] DEBUG  Read U8 0 from reg 0x60
2021-05-14T14:40:49.687 [     i2c] DEBUG  Write 2 hex bytes: [6012]
2021-05-14T14:40:49.691 [     i2c] DEBUG  Write U8 18 to reg 0x60
2021-05-14T14:40:49.694 [     i2c] DEBUG  Write 3 hex bytes: [440020]
2021-05-14T14:40:49.698 [     i2c] DEBUG  Write 2 hex bytes: [01ff]
2021-05-14T14:40:49.702 [     i2c] DEBUG  Write U8 255 to reg 0x1
2021-05-14T14:40:49.705 [     i2c] DEBUG  Write 2 hex bytes: [8001]
2021-05-14T14:40:49.708 [     i2c] DEBUG  Write U8 1 to reg 0x80
2021-05-14T14:40:49.712 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:49.715 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:49.719 [     i2c] DEBUG  Write 2 hex bytes: [0000]
2021-05-14T14:40:49.722 [     i2c] DEBUG  Write U8 0 to reg 0x0
2021-05-14T14:40:49.726 [     i2c] DEBUG  Write 2 hex bytes: [ff06]
2021-05-14T14:40:49.729 [     i2c] DEBUG  Write U8 6 to reg 0xFF
2021-05-14T14:40:49.732 [     i2c] DEBUG  Write 1 hex bytes: [83]
2021-05-14T14:40:49.737 [     i2c] DEBUG  Read 1 hex bytes: [01]
2021-05-14T14:40:49.739 [     i2c] DEBUG  Read U8 1 from reg 0x83
2021-05-14T14:40:49.742 [     i2c] DEBUG  Write 2 hex bytes: [8305]
2021-05-14T14:40:49.747 [     i2c] DEBUG  Write U8 5 to reg 0x83
2021-05-14T14:40:49.749 [     i2c] DEBUG  Write 2 hex bytes: [ff07]
2021-05-14T14:40:49.754 [     i2c] DEBUG  Write U8 7 to reg 0xFF
2021-05-14T14:40:49.757 [     i2c] DEBUG  Write 2 hex bytes: [8101]
2021-05-14T14:40:49.760 [     i2c] DEBUG  Write U8 1 to reg 0x81
2021-05-14T14:40:49.763 [     i2c] DEBUG  Write 2 hex bytes: [8001]
2021-05-14T14:40:49.767 [     i2c] DEBUG  Write U8 1 to reg 0x80
2021-05-14T14:40:49.771 [     i2c] DEBUG  Write 2 hex bytes: [946b]
2021-05-14T14:40:49.775 [     i2c] DEBUG  Write U8 107 to reg 0x94
2021-05-14T14:40:49.778 [     i2c] DEBUG  Write 2 hex bytes: [8300]
2021-05-14T14:40:49.782 [     i2c] DEBUG  Write U8 0 to reg 0x83
2021-05-14T14:40:49.785 [     i2c] DEBUG  Write 1 hex bytes: [83]
2021-05-14T14:40:49.789 [     i2c] DEBUG  Read 1 hex bytes: [10]
2021-05-14T14:40:49.792 [     i2c] DEBUG  Read U8 16 from reg 0x83
2021-05-14T14:40:49.795 [     i2c] DEBUG  Write 2 hex bytes: [8301]
2021-05-14T14:40:49.799 [     i2c] DEBUG  Write U8 1 to reg 0x83
2021-05-14T14:40:49.802 [     i2c] DEBUG  Write 1 hex bytes: [92]
2021-05-14T14:40:49.806 [     i2c] DEBUG  Read 1 hex bytes: [94]
2021-05-14T14:40:49.810 [     i2c] DEBUG  Read U8 148 from reg 0x92
2021-05-14T14:40:49.813 [     i2c] DEBUG  Write 2 hex bytes: [8100]
2021-05-14T14:40:49.817 [     i2c] DEBUG  Write U8 0 to reg 0x81
2021-05-14T14:40:49.820 [     i2c] DEBUG  Write 2 hex bytes: [ff06]
2021-05-14T14:40:49.824 [     i2c] DEBUG  Write U8 6 to reg 0xFF
2021-05-14T14:40:49.827 [     i2c] DEBUG  Write 1 hex bytes: [83]
2021-05-14T14:40:49.831 [     i2c] DEBUG  Read 1 hex bytes: [05]
2021-05-14T14:40:49.835 [     i2c] DEBUG  Read U8 5 from reg 0x83
2021-05-14T14:40:49.838 [     i2c] DEBUG  Write 2 hex bytes: [8301]
2021-05-14T14:40:49.841 [     i2c] DEBUG  Write U8 1 to reg 0x83
2021-05-14T14:40:49.844 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:49.848 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:49.852 [     i2c] DEBUG  Write 2 hex bytes: [0001]
2021-05-14T14:40:49.855 [     i2c] DEBUG  Write U8 1 to reg 0x0
2021-05-14T14:40:49.859 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:49.862 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:49.865 [     i2c] DEBUG  Write 2 hex bytes: [8000]
2021-05-14T14:40:49.869 [     i2c] DEBUG  Write U8 0 to reg 0x80
2021-05-14T14:40:49.873 [     i2c] DEBUG  Write 1 hex bytes: [b0]
2021-05-14T14:40:49.877 [     i2c] DEBUG  Read 6 hex bytes: [fffffffeff0d]
2021-05-14T14:40:49.880 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:49.885 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:49.888 [     i2c] DEBUG  Write 2 hex bytes: [4f00]
2021-05-14T14:40:49.891 [     i2c] DEBUG  Write U8 0 to reg 0x4F
2021-05-14T14:40:49.895 [     i2c] DEBUG  Write 2 hex bytes: [4e2c]
2021-05-14T14:40:49.898 [     i2c] DEBUG  Write U8 44 to reg 0x4E
2021-05-14T14:40:49.901 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:49.905 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:49.908 [     i2c] DEBUG  Write 2 hex bytes: [b6b4]
2021-05-14T14:40:49.912 [     i2c] DEBUG  Write U8 180 to reg 0xB6
2021-05-14T14:40:49.915 [     i2c] DEBUG  Write 7 hex bytes: [b000f0fffe0100]
2021-05-14T14:40:49.919 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:49.923 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:49.926 [     i2c] DEBUG  Write 2 hex bytes: [0000]
2021-05-14T14:40:49.930 [     i2c] DEBUG  Write U8 0 to reg 0x0
2021-05-14T14:40:49.933 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:49.937 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:49.940 [     i2c] DEBUG  Write 2 hex bytes: [0900]
2021-05-14T14:40:49.943 [     i2c] DEBUG  Write U8 0 to reg 0x9
2021-05-14T14:40:49.946 [     i2c] DEBUG  Write 2 hex bytes: [1000]
2021-05-14T14:40:49.950 [     i2c] DEBUG  Write U8 0 to reg 0x10
2021-05-14T14:40:49.953 [     i2c] DEBUG  Write 2 hex bytes: [1100]
2021-05-14T14:40:49.957 [     i2c] DEBUG  Write U8 0 to reg 0x11
2021-05-14T14:40:49.960 [     i2c] DEBUG  Write 2 hex bytes: [2401]
2021-05-14T14:40:49.963 [     i2c] DEBUG  Write U8 1 to reg 0x24
2021-05-14T14:40:49.967 [     i2c] DEBUG  Write 2 hex bytes: [25ff]
2021-05-14T14:40:49.970 [     i2c] DEBUG  Write U8 255 to reg 0x25
2021-05-14T14:40:49.973 [     i2c] DEBUG  Write 2 hex bytes: [7500]
2021-05-14T14:40:49.977 [     i2c] DEBUG  Write U8 0 to reg 0x75
2021-05-14T14:40:49.981 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:49.984 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:49.988 [     i2c] DEBUG  Write 2 hex bytes: [4e2c]
2021-05-14T14:40:49.992 [     i2c] DEBUG  Write U8 44 to reg 0x4E
2021-05-14T14:40:49.995 [     i2c] DEBUG  Write 2 hex bytes: [4800]
2021-05-14T14:40:49.998 [     i2c] DEBUG  Write U8 0 to reg 0x48
2021-05-14T14:40:50.002 [     i2c] DEBUG  Write 2 hex bytes: [3020]
2021-05-14T14:40:50.006 [     i2c] DEBUG  Write U8 32 to reg 0x30
2021-05-14T14:40:50.009 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:50.013 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:50.016 [     i2c] DEBUG  Write 2 hex bytes: [3009]
2021-05-14T14:40:50.020 [     i2c] DEBUG  Write U8 9 to reg 0x30
2021-05-14T14:40:50.023 [     i2c] DEBUG  Write 2 hex bytes: [5400]
2021-05-14T14:40:50.027 [     i2c] DEBUG  Write U8 0 to reg 0x54
2021-05-14T14:40:50.029 [     i2c] DEBUG  Write 2 hex bytes: [3104]
2021-05-14T14:40:50.034 [     i2c] DEBUG  Write U8 4 to reg 0x31
2021-05-14T14:40:50.036 [     i2c] DEBUG  Write 2 hex bytes: [3203]
2021-05-14T14:40:50.041 [     i2c] DEBUG  Write U8 3 to reg 0x32
2021-05-14T14:40:50.043 [     i2c] DEBUG  Write 2 hex bytes: [4083]
2021-05-14T14:40:50.047 [     i2c] DEBUG  Write U8 131 to reg 0x40
2021-05-14T14:40:50.050 [     i2c] DEBUG  Write 2 hex bytes: [4625]
2021-05-14T14:40:50.054 [     i2c] DEBUG  Write U8 37 to reg 0x46
2021-05-14T14:40:50.057 [     i2c] DEBUG  Write 2 hex bytes: [6000]
2021-05-14T14:40:50.060 [     i2c] DEBUG  Write U8 0 to reg 0x60
2021-05-14T14:40:50.063 [     i2c] DEBUG  Write 2 hex bytes: [2700]
2021-05-14T14:40:50.067 [     i2c] DEBUG  Write U8 0 to reg 0x27
2021-05-14T14:40:50.071 [     i2c] DEBUG  Write 2 hex bytes: [5006]
2021-05-14T14:40:50.074 [     i2c] DEBUG  Write U8 6 to reg 0x50
2021-05-14T14:40:50.077 [     i2c] DEBUG  Write 2 hex bytes: [5100]
2021-05-14T14:40:50.081 [     i2c] DEBUG  Write U8 0 to reg 0x51
2021-05-14T14:40:50.084 [     i2c] DEBUG  Write 2 hex bytes: [5296]
2021-05-14T14:40:50.088 [     i2c] DEBUG  Write U8 150 to reg 0x52
2021-05-14T14:40:50.091 [     i2c] DEBUG  Write 2 hex bytes: [5608]
2021-05-14T14:40:50.095 [     i2c] DEBUG  Write U8 8 to reg 0x56
2021-05-14T14:40:50.098 [     i2c] DEBUG  Write 2 hex bytes: [5730]
2021-05-14T14:40:50.102 [     i2c] DEBUG  Write U8 48 to reg 0x57
2021-05-14T14:40:50.105 [     i2c] DEBUG  Write 2 hex bytes: [6100]
2021-05-14T14:40:50.108 [     i2c] DEBUG  Write U8 0 to reg 0x61
2021-05-14T14:40:50.112 [     i2c] DEBUG  Write 2 hex bytes: [6200]
2021-05-14T14:40:50.116 [     i2c] DEBUG  Write U8 0 to reg 0x62
2021-05-14T14:40:50.119 [     i2c] DEBUG  Write 2 hex bytes: [6400]
2021-05-14T14:40:50.123 [     i2c] DEBUG  Write U8 0 to reg 0x64
2021-05-14T14:40:50.126 [     i2c] DEBUG  Write 2 hex bytes: [6500]
2021-05-14T14:40:50.130 [     i2c] DEBUG  Write U8 0 to reg 0x65
2021-05-14T14:40:50.133 [     i2c] DEBUG  Write 2 hex bytes: [66a0]
2021-05-14T14:40:50.137 [     i2c] DEBUG  Write U8 160 to reg 0x66
2021-05-14T14:40:50.140 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:50.144 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:50.147 [     i2c] DEBUG  Write 2 hex bytes: [2232]
2021-05-14T14:40:50.150 [     i2c] DEBUG  Write U8 50 to reg 0x22
2021-05-14T14:40:50.154 [     i2c] DEBUG  Write 2 hex bytes: [4714]
2021-05-14T14:40:50.158 [     i2c] DEBUG  Write U8 20 to reg 0x47
2021-05-14T14:40:50.161 [     i2c] DEBUG  Write 2 hex bytes: [49ff]
2021-05-14T14:40:50.165 [     i2c] DEBUG  Write U8 255 to reg 0x49
2021-05-14T14:40:50.168 [     i2c] DEBUG  Write 2 hex bytes: [4a00]
2021-05-14T14:40:50.172 [     i2c] DEBUG  Write U8 0 to reg 0x4A
2021-05-14T14:40:50.175 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:50.179 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:50.182 [     i2c] DEBUG  Write 2 hex bytes: [7a0a]
2021-05-14T14:40:50.186 [     i2c] DEBUG  Write U8 10 to reg 0x7A
2021-05-14T14:40:50.189 [     i2c] DEBUG  Write 2 hex bytes: [7b00]
2021-05-14T14:40:50.193 [     i2c] DEBUG  Write U8 0 to reg 0x7B
2021-05-14T14:40:50.196 [     i2c] DEBUG  Write 2 hex bytes: [7821]
2021-05-14T14:40:50.199 [     i2c] DEBUG  Write U8 33 to reg 0x78
2021-05-14T14:40:50.203 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:50.207 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:50.210 [     i2c] DEBUG  Write 2 hex bytes: [2334]
2021-05-14T14:40:50.214 [     i2c] DEBUG  Write U8 52 to reg 0x23
2021-05-14T14:40:50.217 [     i2c] DEBUG  Write 2 hex bytes: [4200]
2021-05-14T14:40:50.221 [     i2c] DEBUG  Write U8 0 to reg 0x42
2021-05-14T14:40:50.224 [     i2c] DEBUG  Write 2 hex bytes: [44ff]
2021-05-14T14:40:50.228 [     i2c] DEBUG  Write U8 255 to reg 0x44
2021-05-14T14:40:50.231 [     i2c] DEBUG  Write 2 hex bytes: [4526]
2021-05-14T14:40:50.234 [     i2c] DEBUG  Write U8 38 to reg 0x45
2021-05-14T14:40:50.238 [     i2c] DEBUG  Write 2 hex bytes: [4605]
2021-05-14T14:40:50.242 [     i2c] DEBUG  Write U8 5 to reg 0x46
2021-05-14T14:40:50.245 [     i2c] DEBUG  Write 2 hex bytes: [4040]
2021-05-14T14:40:50.249 [     i2c] DEBUG  Write U8 64 to reg 0x40
2021-05-14T14:40:50.252 [     i2c] DEBUG  Write 2 hex bytes: [0e06]
2021-05-14T14:40:50.255 [     i2c] DEBUG  Write U8 6 to reg 0xE
2021-05-14T14:40:50.259 [     i2c] DEBUG  Write 2 hex bytes: [201a]
2021-05-14T14:40:50.263 [     i2c] DEBUG  Write U8 26 to reg 0x20
2021-05-14T14:40:50.266 [     i2c] DEBUG  Write 2 hex bytes: [4340]
2021-05-14T14:40:50.270 [     i2c] DEBUG  Write U8 64 to reg 0x43
2021-05-14T14:40:50.273 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:50.277 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:50.280 [     i2c] DEBUG  Write 2 hex bytes: [3403]
2021-05-14T14:40:50.284 [     i2c] DEBUG  Write U8 3 to reg 0x34
2021-05-14T14:40:50.287 [     i2c] DEBUG  Write 2 hex bytes: [3544]
2021-05-14T14:40:50.291 [     i2c] DEBUG  Write U8 68 to reg 0x35
2021-05-14T14:40:50.293 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:50.296 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:50.300 [     i2c] DEBUG  Write 2 hex bytes: [3104]
2021-05-14T14:40:50.304 [     i2c] DEBUG  Write U8 4 to reg 0x31
2021-05-14T14:40:50.306 [     i2c] DEBUG  Write 2 hex bytes: [4b09]
2021-05-14T14:40:50.311 [     i2c] DEBUG  Write U8 9 to reg 0x4B
2021-05-14T14:40:50.313 [     i2c] DEBUG  Write 2 hex bytes: [4c05]
2021-05-14T14:40:50.317 [     i2c] DEBUG  Write U8 5 to reg 0x4C
2021-05-14T14:40:50.321 [     i2c] DEBUG  Write 2 hex bytes: [4d04]
2021-05-14T14:40:50.325 [     i2c] DEBUG  Write U8 4 to reg 0x4D
2021-05-14T14:40:50.328 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:50.332 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:50.335 [     i2c] DEBUG  Write 2 hex bytes: [4400]
2021-05-14T14:40:50.339 [     i2c] DEBUG  Write U8 0 to reg 0x44
2021-05-14T14:40:50.342 [     i2c] DEBUG  Write 2 hex bytes: [4520]
2021-05-14T14:40:50.346 [     i2c] DEBUG  Write U8 32 to reg 0x45
2021-05-14T14:40:50.349 [     i2c] DEBUG  Write 2 hex bytes: [4708]
2021-05-14T14:40:50.352 [     i2c] DEBUG  Write U8 8 to reg 0x47
2021-05-14T14:40:50.355 [     i2c] DEBUG  Write 2 hex bytes: [4828]
2021-05-14T14:40:50.359 [     i2c] DEBUG  Write U8 40 to reg 0x48
2021-05-14T14:40:50.362 [     i2c] DEBUG  Write 2 hex bytes: [6700]
2021-05-14T14:40:50.366 [     i2c] DEBUG  Write U8 0 to reg 0x67
2021-05-14T14:40:50.369 [     i2c] DEBUG  Write 2 hex bytes: [7004]
2021-05-14T14:40:50.373 [     i2c] DEBUG  Write U8 4 to reg 0x70
2021-05-14T14:40:50.377 [     i2c] DEBUG  Write 2 hex bytes: [7101]
2021-05-14T14:40:50.380 [     i2c] DEBUG  Write U8 1 to reg 0x71
2021-05-14T14:40:50.383 [     i2c] DEBUG  Write 2 hex bytes: [72fe]
2021-05-14T14:40:50.387 [     i2c] DEBUG  Write U8 254 to reg 0x72
2021-05-14T14:40:50.390 [     i2c] DEBUG  Write 2 hex bytes: [7600]
2021-05-14T14:40:50.394 [     i2c] DEBUG  Write U8 0 to reg 0x76
2021-05-14T14:40:50.397 [     i2c] DEBUG  Write 2 hex bytes: [7700]
2021-05-14T14:40:50.401 [     i2c] DEBUG  Write U8 0 to reg 0x77
2021-05-14T14:40:50.405 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:50.408 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:50.411 [     i2c] DEBUG  Write 2 hex bytes: [0d01]
2021-05-14T14:40:50.415 [     i2c] DEBUG  Write U8 1 to reg 0xD
2021-05-14T14:40:50.418 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:50.422 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:50.425 [     i2c] DEBUG  Write 2 hex bytes: [8001]
2021-05-14T14:40:50.429 [     i2c] DEBUG  Write U8 1 to reg 0x80
2021-05-14T14:40:50.432 [     i2c] DEBUG  Write 2 hex bytes: [01f8]
2021-05-14T14:40:50.436 [     i2c] DEBUG  Write U8 248 to reg 0x1
2021-05-14T14:40:50.440 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:50.443 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:50.447 [     i2c] DEBUG  Write 2 hex bytes: [8e01]
2021-05-14T14:40:50.450 [     i2c] DEBUG  Write U8 1 to reg 0x8E
2021-05-14T14:40:50.453 [     i2c] DEBUG  Write 2 hex bytes: [0001]
2021-05-14T14:40:50.457 [     i2c] DEBUG  Write U8 1 to reg 0x0
2021-05-14T14:40:50.459 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:50.465 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:50.468 [     i2c] DEBUG  Write 2 hex bytes: [8000]
2021-05-14T14:40:50.472 [     i2c] DEBUG  Write U8 0 to reg 0x80
2021-05-14T14:40:50.475 [     i2c] DEBUG  Write 2 hex bytes: [0a04]
2021-05-14T14:40:50.478 [     i2c] DEBUG  Write U8 4 to reg 0xA
2021-05-14T14:40:50.481 [     i2c] DEBUG  Write 1 hex bytes: [84]
2021-05-14T14:40:50.485 [     i2c] DEBUG  Read 1 hex bytes: [01]
2021-05-14T14:40:50.489 [     i2c] DEBUG  Read U8 1 from reg 0x84
2021-05-14T14:40:50.492 [     i2c] DEBUG  Write 2 hex bytes: [8401]
2021-05-14T14:40:50.496 [     i2c] DEBUG  Write U8 1 to reg 0x84
2021-05-14T14:40:50.499 [     i2c] DEBUG  Write 2 hex bytes: [0b01]
2021-05-14T14:40:50.503 [     i2c] DEBUG  Write U8 1 to reg 0xB
2021-05-14T14:40:50.505 [ vl53l0x] DEBUG  Start getting sequence step enables
2021-05-14T14:40:50.509 [     i2c] DEBUG  Write 1 hex bytes: [01]
2021-05-14T14:40:50.514 [     i2c] DEBUG  Read 1 hex bytes: [f8]
2021-05-14T14:40:50.517 [     i2c] DEBUG  Read U8 248 from reg 0x1
2021-05-14T14:40:50.519 [ vl53l0x] DEBUG  Start getting sequence step timeouts
2021-05-14T14:40:50.523 [ vl53l0x] DEBUG  Start getting VCSEL pulse period
2021-05-14T14:40:50.527 [     i2c] DEBUG  Write 1 hex bytes: [50]
2021-05-14T14:40:50.531 [     i2c] DEBUG  Read 1 hex bytes: [06]
2021-05-14T14:40:50.534 [     i2c] DEBUG  Read U8 6 from reg 0x50
2021-05-14T14:40:50.537 [     i2c] DEBUG  Write 1 hex bytes: [46]
2021-05-14T14:40:50.541 [     i2c] DEBUG  Read 1 hex bytes: [25]
2021-05-14T14:40:50.545 [     i2c] DEBUG  Read U8 37 from reg 0x46
2021-05-14T14:40:50.548 [     i2c] DEBUG  Write 1 hex bytes: [51]
2021-05-14T14:40:50.552 [     i2c] DEBUG  Read 2 hex bytes: [0096]
2021-05-14T14:40:50.555 [ vl53l0x] DEBUG  Start getting VCSEL pulse period
2021-05-14T14:40:50.559 [     i2c] DEBUG  Write 1 hex bytes: [70]
2021-05-14T14:40:50.562 [     i2c] DEBUG  Read 1 hex bytes: [04]
2021-05-14T14:40:50.566 [     i2c] DEBUG  Read U8 4 from reg 0x70
2021-05-14T14:40:50.569 [     i2c] DEBUG  Write 1 hex bytes: [71]
2021-05-14T14:40:50.573 [     i2c] DEBUG  Read 2 hex bytes: [01fe]
2021-05-14T14:40:50.577 [     i2c] DEBUG  Write 2 hex bytes: [01e8]
2021-05-14T14:40:50.580 [     i2c] DEBUG  Write U8 232 to reg 0x1
2021-05-14T14:40:50.583 [ vl53l0x] DEBUG  Start setting measurement timing budget
2021-05-14T14:40:50.586 [ vl53l0x] DEBUG  Start getting sequence step enables
2021-05-14T14:40:50.590 [     i2c] DEBUG  Write 1 hex bytes: [01]
2021-05-14T14:40:50.594 [     i2c] DEBUG  Read 1 hex bytes: [e8]
2021-05-14T14:40:50.597 [     i2c] DEBUG  Read U8 232 from reg 0x1
2021-05-14T14:40:50.601 [ vl53l0x] DEBUG  Sequence step enables = (*vl53l0x.SequenceStepEnables){TCC:(bool)false MSRC:(bool)false DSS:(bool)true PreRange:(bool)true FinalRange:(bool)true}
2021-05-14T14:40:50.603 [ vl53l0x] DEBUG  Start getting sequence step timeouts
2021-05-14T14:40:50.607 [ vl53l0x] DEBUG  Start getting VCSEL pulse period
2021-05-14T14:40:50.610 [     i2c] DEBUG  Write 1 hex bytes: [50]
2021-05-14T14:40:50.615 [     i2c] DEBUG  Read 1 hex bytes: [06]
2021-05-14T14:40:50.618 [     i2c] DEBUG  Read U8 6 from reg 0x50
2021-05-14T14:40:50.620 [     i2c] DEBUG  Write 1 hex bytes: [46]
2021-05-14T14:40:50.625 [     i2c] DEBUG  Read 1 hex bytes: [25]
2021-05-14T14:40:50.628 [     i2c] DEBUG  Read U8 37 from reg 0x46
2021-05-14T14:40:50.631 [     i2c] DEBUG  Write 1 hex bytes: [51]
2021-05-14T14:40:50.636 [     i2c] DEBUG  Read 2 hex bytes: [0096]
2021-05-14T14:40:50.639 [ vl53l0x] DEBUG  Start getting VCSEL pulse period
2021-05-14T14:40:50.642 [     i2c] DEBUG  Write 1 hex bytes: [70]
2021-05-14T14:40:50.646 [     i2c] DEBUG  Read 1 hex bytes: [04]
2021-05-14T14:40:50.649 [     i2c] DEBUG  Read U8 4 from reg 0x70
2021-05-14T14:40:50.652 [     i2c] DEBUG  Write 1 hex bytes: [71]
2021-05-14T14:40:50.657 [     i2c] DEBUG  Read 2 hex bytes: [01fe]
2021-05-14T14:40:50.660 [ vl53l0x] DEBUG  Sequence step timeouts = (*vl53l0x.SequenceStepTimeouts){PreRangeVcselPeriodPclks:(uint16)14 FinalRangeVcselPeriodPclks:(uint16)10 MsrcDssTccMclks:(uint16)38 PreRangeMclks:(uint16)151 FinalRangeMclks:(uint16)358 MsrcDssTccUsec:(uint32)2055 PreRangeUsec:(uint32)8087 FinalRangeUsec:(uint32)13669}
2021-05-14T14:40:50.663 [ vl53l0x] DEBUG  set_sequence_step_timeout() begin
2021-05-14T14:40:50.666 [     i2c] DEBUG  Write 3 hex bytes: [710294]
2021-05-14T14:40:50.670 [ vl53l0x] DEBUG  set_sequence_step_timeout() end
2021-05-14T14:40:50.672 [ vl53l0x] DEBUG  End setting measurement timing budget
2021-05-14T14:40:50.676 [     i2c] DEBUG  Write 2 hex bytes: [0101]
2021-05-14T14:40:50.680 [     i2c] DEBUG  Write U8 1 to reg 0x1
2021-05-14T14:40:50.683 [     i2c] DEBUG  Write 2 hex bytes: [0041]
2021-05-14T14:40:50.688 [     i2c] DEBUG  Write U8 65 to reg 0x0
2021-05-14T14:40:50.690 [     i2c] DEBUG  Write 1 hex bytes: [13]
2021-05-14T14:40:50.695 [     i2c] DEBUG  Read 1 hex bytes: [40]
2021-05-14T14:40:50.698 [     i2c] DEBUG  Read U8 64 from reg 0x13
2021-05-14T14:40:50.702 [     i2c] DEBUG  Write 1 hex bytes: [13]
2021-05-14T14:40:50.706 [     i2c] DEBUG  Read 1 hex bytes: [44]
2021-05-14T14:40:50.709 [     i2c] DEBUG  Read U8 68 from reg 0x13
2021-05-14T14:40:50.712 [     i2c] DEBUG  Write 2 hex bytes: [0b01]
2021-05-14T14:40:50.716 [     i2c] DEBUG  Write U8 1 to reg 0xB
2021-05-14T14:40:50.719 [     i2c] DEBUG  Write 2 hex bytes: [0000]
2021-05-14T14:40:50.722 [     i2c] DEBUG  Write U8 0 to reg 0x0
2021-05-14T14:40:50.725 [     i2c] DEBUG  Write 2 hex bytes: [0102]
2021-05-14T14:40:50.729 [     i2c] DEBUG  Write U8 2 to reg 0x1
2021-05-14T14:40:50.732 [     i2c] DEBUG  Write 2 hex bytes: [0001]
2021-05-14T14:40:50.736 [     i2c] DEBUG  Write U8 1 to reg 0x0
2021-05-14T14:40:50.739 [     i2c] DEBUG  Write 1 hex bytes: [13]
2021-05-14T14:40:50.744 [     i2c] DEBUG  Read 1 hex bytes: [44]
2021-05-14T14:40:50.747 [     i2c] DEBUG  Read U8 68 from reg 0x13
2021-05-14T14:40:50.750 [     i2c] DEBUG  Write 2 hex bytes: [0b01]
2021-05-14T14:40:50.754 [     i2c] DEBUG  Write U8 1 to reg 0xB
2021-05-14T14:40:50.757 [     i2c] DEBUG  Write 2 hex bytes: [0000]
2021-05-14T14:40:50.761 [     i2c] DEBUG  Write U8 0 to reg 0x0
2021-05-14T14:40:50.763 [     i2c] DEBUG  Write 2 hex bytes: [01e8]
2021-05-14T14:40:50.766 [     i2c] DEBUG  Write U8 232 to reg 0x1
2021-05-14T14:40:50.770 [ vl53l0x] DEBUG  Read range single
2021-05-14T14:40:50.774 [     i2c] DEBUG  Write 2 hex bytes: [8001]
2021-05-14T14:40:50.777 [     i2c] DEBUG  Write U8 1 to reg 0x80
2021-05-14T14:40:50.781 [     i2c] DEBUG  Write 2 hex bytes: [ff01]
2021-05-14T14:40:50.785 [     i2c] DEBUG  Write U8 1 to reg 0xFF
2021-05-14T14:40:50.788 [     i2c] DEBUG  Write 2 hex bytes: [0000]
2021-05-14T14:40:50.792 [     i2c] DEBUG  Write U8 0 to reg 0x0
2021-05-14T14:40:50.795 [     i2c] DEBUG  Write 2 hex bytes: [913c]
2021-05-14T14:40:50.799 [     i2c] DEBUG  Write U8 60 to reg 0x91
2021-05-14T14:40:50.802 [     i2c] DEBUG  Write 2 hex bytes: [0001]
2021-05-14T14:40:50.806 [     i2c] DEBUG  Write U8 1 to reg 0x0
2021-05-14T14:40:50.808 [     i2c] DEBUG  Write 2 hex bytes: [ff00]
2021-05-14T14:40:50.813 [     i2c] DEBUG  Write U8 0 to reg 0xFF
2021-05-14T14:40:50.815 [     i2c] DEBUG  Write 2 hex bytes: [8000]
2021-05-14T14:40:50.819 [     i2c] DEBUG  Write U8 0 to reg 0x80
2021-05-14T14:40:50.822 [     i2c] DEBUG  Write 2 hex bytes: [0001]
2021-05-14T14:40:50.826 [     i2c] DEBUG  Write U8 1 to reg 0x0
2021-05-14T14:40:50.829 [     i2c] DEBUG  Write 1 hex bytes: [00]
2021-05-14T14:40:50.833 [     i2c] DEBUG  Read 1 hex bytes: [00]
2021-05-14T14:40:50.837 [     i2c] DEBUG  Read U8 0 from reg 0x0
2021-05-14T14:40:50.840 [     i2c] DEBUG  Write 1 hex bytes: [13]
2021-05-14T14:40:50.844 [     i2c] DEBUG  Read 1 hex bytes: [40]
2021-05-14T14:40:50.847 [     i2c] DEBUG  Read U8 64 from reg 0x13
2021-05-14T14:40:50.850 [     i2c] DEBUG  Write 1 hex bytes: [13]
2021-05-14T14:40:50.854 [     i2c] DEBUG  Read 1 hex bytes: [40]
2021-05-14T14:40:50.857 [     i2c] DEBUG  Read U8 64 from reg 0x13
2021-05-14T14:40:50.861 [     i2c] DEBUG  Write 1 hex bytes: [13]
2021-05-14T14:40:50.865 [     i2c] DEBUG  Read 1 hex bytes: [44]
2021-05-14T14:40:50.867 [     i2c] DEBUG  Read U8 68 from reg 0x13
2021-05-14T14:40:50.871 [     i2c] DEBUG  Write 1 hex bytes: [1e]
2021-05-14T14:40:50.875 [     i2c] DEBUG  Read 2 hex bytes: [00c9]
2021-05-14T14:40:50.879 [     i2c] DEBUG  Write 2 hex bytes: [0b01]
2021-05-14T14:40:50.882 [     i2c] DEBUG  Write U8 1 to reg 0xB
2021/05/14 14:40:50 Measured range = 201 mm