Skip to content

Commit

Permalink
Make voltage output easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
vaelen committed Dec 24, 2019
1 parent a3d300e commit 9a5d79e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions voltmeter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ package main

import (
"context"
"fmt"
"log"
"time"

Expand Down Expand Up @@ -68,9 +69,11 @@ func main() {

for {
allAD10 := read(controller)
i := allAD10[0]
v := float32(i) * V
log.Printf("%04d - %01.3fV\n", i, v)
allV := make([]string, len(allAD10))
for n, i := range allAD10 {
allV[n] = fmt.Sprintf("[%02d, %04d, %01.3fV]", n, i, float32(i) * V)
}
log.Println(allV)
time.Sleep(time.Millisecond * 10)
}

Expand Down

0 comments on commit 9a5d79e

Please sign in to comment.