mirror of
https://github.com/Fishwaldo/go-dcdc200.git
synced 2025-03-15 19:41:23 +00:00
Update readme accoridng to godoc
This commit is contained in:
parent
e0bde6bed3
commit
38fb8bb9be
1 changed files with 39 additions and 1 deletions
40
README.md
40
README.md
|
@ -1 +1,39 @@
|
||||||
# go-dcdcusb200
|
# Go-DCDCUSB
|
||||||
|
|
||||||
|
[](https://codecov.io/gh/Fishwaldo/go-dcdcusb200)
|
||||||
|
[](http://pkg.go.dev/github.com/Fishwaldo/go-dcdcusb200)
|
||||||
|
|
||||||
|
Package go-dcdcusb interfaces with the DCDCUSB power supply from mini-box ([https://www.mini-box.com/DCDC-USB](https://www.mini-box.com/DCDC-USB))
|
||||||
|
via USB port and allows you to retrive the status of the power supply
|
||||||
|
|
||||||
|
it depends upon GoUSB which in turn depends upon the libusb C library, thus CGO is required for this module
|
||||||
|
|
||||||
|
Please see the GoUSB pages for hints on compiling for platforms other than linux
|
||||||
|
|
||||||
|
## Sub Packages
|
||||||
|
|
||||||
|
* [cmd](./cmd)
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```golang
|
||||||
|
|
||||||
|
dc := dcdcusb.DcDcUSB{}
|
||||||
|
dc.Init()
|
||||||
|
if ok, err := dc.Scan(); !ok {
|
||||||
|
log.Fatalf("Scan Failed: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer dc.Close()
|
||||||
|
for i := 0; i < 100; i++ {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), (1 * time.Second))
|
||||||
|
dc.GetAllParam(ctx)
|
||||||
|
cancel()
|
||||||
|
time.Sleep(1 * time.Second)
|
||||||
|
}
|
||||||
|
dc.Close()
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
Readme created from Go doc with [goreadme](https://github.com/posener/goreadme)
|
||||||
|
|
Loading…
Add table
Reference in a new issue