Skip to content

Instantly share code, notes, and snippets.

@taiyoh
Last active January 2, 2016 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taiyoh/8263558 to your computer and use it in GitHub Desktop.
Save taiyoh/8263558 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/taiyoh/go-cm160"
)
func main() {
volt := 100
device := cm160.Open()
defer device.Close()
device.Wait(func(rec *cm160.Record) {
// TODO
if rec.IsLive {
rec.CalcWatt(volt)
fmt.Printf("record: %#v\n", rec)
}
})
fmt.Println("exit process")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment