https://github.com/damdo/i2c-scanner
i2c bus scanner for linux, in pure Go
https://github.com/damdo/i2c-scanner
go gokrazy golang i2c
Last synced: about 1 month ago
JSON representation
i2c bus scanner for linux, in pure Go
- Host: GitHub
- URL: https://github.com/damdo/i2c-scanner
- Owner: damdo
- License: apache-2.0
- Created: 2024-02-02T15:07:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-06-03T06:52:58.000Z (about 2 months ago)
- Last Synced: 2026-06-03T08:30:05.869Z (about 2 months ago)
- Topics: go, gokrazy, golang, i2c
- Language: Go
- Homepage:
- Size: 48.8 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## i2c-scanner
I2C bus scanner for linux.
Written in pure Go, can be compiled to a static binary without dependencies.
### installation
```
go install github.com/damdo/i2c-scanner@latest
```
### usage
```
i2c-scanner
```
the output will look similar to this:
```
$ i2c-scanner
I2C buses available:
- name: /dev/i2c-0
number: 0
aliases: I2C0
pins:
* SDA: I2C0_SDA(GPIO0)
* SCL: I2C0_SCL(GPIO1)
devices:
* addr: 0x39 (57)
- name: /dev/i2c-1
number: 1
aliases: I2C1
pins:
* SDA: I2C1_SDA(GPIO2)
* SCL: I2C1_SCL(GPIO3)
devices:
* addr: 0x37 (55)
* addr: 0x3A (58)
* addr: 0x4A (74)
* addr: 0x4B (75)
* addr: 0x50 (80)
* addr: 0x54 (84)
- name: /dev/i2c-2
number: 2
aliases: I2C2
pins:
* SDA: INVALID
* SCL: INVALID
devices: none found
- name: /dev/i2c-3
number: 3
aliases: I2C3
pins:
* SDA: INVALID
* SCL: INVALID
devices: none found
```
### credits
Code heavily inspired by: https://pkg.go.dev/periph.io/x/periph/conn/i2c