setup ticker

This commit is contained in:
Russell Stanley 2022-01-06 16:54:30 +10:30 committed by Saxon Nelson-Milton
parent bdb44214a1
commit 0c6d9d0132
1 changed files with 19 additions and 5 deletions

View File

@ -11,6 +11,7 @@ AUTHORS
Jack Richardson <jack@ausocean.org>
Trek Hopton <trek@ausocean.org>
Scott Barnard <scott@ausocean.org>
Russell Stanley <russell@ausocean.org>
LICENSE
Copyright (C) 2020 the Australian Ocean Lab (AusOcean)
@ -103,6 +104,7 @@ const (
profilePath = "rv.prof"
pkg = "rv: "
runPreDelay = 20 * time.Second
turbidity
)
// Software define pin values.
@ -122,6 +124,18 @@ type turbidityProbe struct {
// TODO(Russell): complete this implementation of Write.
func (tp *turbidityProbe) Write(p []byte) (int, error) {
ticker := time.NewTicker(500 * time.Millisecond)
go func() {
for {
select {
case <-ticker.C:
// Implementation here
}
}
}()
return len(p), nil
}