mirror of
https://github.com/kidoman/embd
synced 2024-06-14 22:59:53 +02:00
fixed OneWire bus concurrency & sample
This commit is contained in:
parent
199e05ae40
commit
d8c3f57dc1
|
@ -24,7 +24,7 @@ type w1Device struct {
|
||||||
file *os.File
|
file *os.File
|
||||||
addr string
|
addr string
|
||||||
initialized bool
|
initialized bool
|
||||||
bus w1Bus
|
bus *w1Bus
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewW1Bus(l byte) embd.W1Bus {
|
func NewW1Bus(l byte) embd.W1Bus {
|
||||||
|
|
|
@ -24,7 +24,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, dev := range devs {
|
for _, dev := range devs {
|
||||||
fmt.Println("OneWire device: %s", dev)
|
fmt.Printf("OneWire device: %s\n", dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
w1d, err := w1.Open("28-011572120bff")
|
w1d, err := w1.Open("28-011572120bff")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user