Skip to content
Snippets Groups Projects
Commit 85158cc3 authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

Initial stab at a command line tool.

parent fafc6ef2
No related branches found
No related tags found
No related merge requests found
Pipeline #
/gqgmc
/gqgmcd
//
// main.go
// Copyright (C) 2017 kevin <kevin@phrye.com>
//
// Distributed under terms of the GPL license.
//
package main
import (
"fmt"
"gitlab.com/lyda/gqgmc/devices/geiger"
)
func main() {
var (
gc geiger.Counter
cpm uint16
err error
)
gc, err = geiger.New(geiger.Config{
Model: "gqgmc",
Device: "/dev/gqgmc",
})
if err != nil {
fmt.Printf("Failed to connect to geiger counter: '%s'\n", err)
return
}
cpm, err = gc.GetCPM()
if err != nil {
fmt.Printf("Failed to connect to geiger counter: '%s'\n", err)
return
}
fmt.Printf("CPM: %d\n", cpm)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment