{"id":21028042,"url":"https://github.com/d2r2/go-vl53l0x","last_synced_at":"2025-07-30T05:04:19.378Z","repository":{"id":57494557,"uuid":"155968698","full_name":"d2r2/go-vl53l0x","owner":"d2r2","description":"Golang library to interact with ST VL53L0X time-of-flight ranging sensor via I2C-bus from Raspberry PI.","archived":false,"fork":false,"pushed_at":"2018-12-22T17:11:12.000Z","size":1567,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T10:40:50.283Z","etag":null,"topics":["embedded-linux","golang","gpio","i2c","i2c-sensors","ranging-sensor","raspberry-pi","vl53l0x"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d2r2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-03T09:31:24.000Z","updated_at":"2023-09-04T19:47:08.000Z","dependencies_parsed_at":"2022-09-02T19:51:15.756Z","dependency_job_id":null,"html_url":"https://github.com/d2r2/go-vl53l0x","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d2r2/go-vl53l0x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-vl53l0x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-vl53l0x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-vl53l0x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-vl53l0x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d2r2","download_url":"https://codeload.github.com/d2r2/go-vl53l0x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-vl53l0x/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267814307,"owners_count":24148327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-linux","golang","gpio","i2c","i2c-sensors","ranging-sensor","raspberry-pi","vl53l0x"],"created_at":"2024-11-19T11:53:44.209Z","updated_at":"2025-07-30T05:04:19.329Z","avatar_url":"https://github.com/d2r2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"VL53L0X time-of-flight ranging sensor\n=====================================\n\n[![Build Status](https://travis-ci.org/d2r2/go-vl53l0x.svg?branch=master)](https://travis-ci.org/d2r2/go-vl53l0x)\n[![Go Report Card](https://goreportcard.com/badge/github.com/d2r2/go-vl53l0x)](https://goreportcard.com/report/github.com/d2r2/go-vl53l0x)\n[![GoDoc](https://godoc.org/github.com/d2r2/go-vl53l0x?status.svg)](https://godoc.org/github.com/d2r2/go-vl53l0x)\n[![MIT License](http://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\nVL53L0X ([general specification](https://raw.github.com/d2r2/go-vl53l0x/master/docs/vl53l0x.pdf), [native C code API specification](https://raw.github.com/d2r2/go-vl53l0x/master/docs/en.DM00279088.pdf)) is a world’s smallest time-of-flight ranging and gesture detection sensor from STMicroelectronics. Easily integrated with Arduino and Raspberry PI via i2c communication interface:\n![image](https://raw.github.com/d2r2/go-vl53l0x/master/docs/cjvl53l0xv2.jpg)\n\nSensor functionality is based on laser diode emission with following photodetector signal registration. Average time duration between emission and registration is a \"time-of-flight\", which translates to range distance.\n\nHere is a library written in [Go programming language](https://golang.org/) for Raspberry PI and counterparts, which gives you in the output measured range value (making all necessary i2c-bus interacting and values computing).\n\nThis library is an adaptation and translation of well-formed C++ code written by www.pololu.com to Golang, taken from https://github.com/pololu/vl53l0x-arduino.\n\n\nGolang usage\n------------\n\n```go\nfunc main() {\n    // Create new connection to i2c-bus on 0 line with address 0x29.\n    // Use i2cdetect utility to find device address over the i2c-bus\n    i2c, err := i2c.NewI2C(0x29, 0)\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer i2c.Close()\n\n    sensor := vl53l0x.NewVl53l0x()\n    // It's highly recommended to reset sensor each time before repeated initialization.\n    err = sensor.Reset(i2c)\n    if err != nil {\n        log.Fatal(err)\n    }\n    // By default, sensor initialized with \"RegularRange\" and \"RegularAccuracy\" parameters.\n    err = sensor.Init(i2c)\n    if err != nil {\n        log.Fatal(err)\n    }\n    rng, err := sensor.ReadRangeSingleMillimeters(i2c)\n    if err != nil {\n        log.Fatal(err)\n    }\n    log.Printf(\"Measured range = %v mm\", rng)\n```\n\n\nGetting help\n------------\n\nGoDoc [documentation](http://godoc.org/github.com/d2r2/go-vl53l0x)\n\n\nInstallation\n------------\n\n```bash\n$ go get -u github.com/d2r2/go-vl53l0x\n```\n\n\nTroubleshooting\n---------------\n\n- *How to obtain fresh Golang installation to RPi device (either any RPi clone):*\nIf your RaspberryPI golang installation taken by default from repository is outdated, you may consider\nto install actual golang manually from official Golang [site](https://golang.org/dl/). Download\ntar.gz file containing armv6l in the name. Follow installation instructions.\n\n- *How to enable I2C bus on RPi device:*\nIf you employ RaspberryPI, use raspi-config utility to activate i2c-bus on the OS level.\nGo to \"Interfacing Options\" menu, to active I2C bus.\nProbably you will need to reboot to load i2c kernel module.\nFinally you should have device like /dev/i2c-1 present in the system.\n\n- *How to find I2C bus allocation and device address:*\nUse i2cdetect utility in format \"i2cdetect -y X\", where X may vary from 0 to 5 or more,\nto discover address occupied by peripheral device. To install utility you should run\n`apt install i2c-tools` on debian-kind system. `i2cdetect -y 1` sample output:\n    ```\n         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n    00:          -- -- -- -- -- -- -- -- -- -- -- -- --\n    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n    70: -- -- -- -- -- -- 76 --    \n    ```\n\n\nContact\n-------\n\nPlease use [Github issue tracker](https://github.com/d2r2/go-vl53l0x/issues) for filing bugs or feature requests.\n\n\nLicense\n-------\n\nGo-vl53l0x is licensed under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2r2%2Fgo-vl53l0x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd2r2%2Fgo-vl53l0x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2r2%2Fgo-vl53l0x/lists"}