mirror of
https://github.com/kidoman/embd
synced 2025-07-03 20:07:40 +02:00
samples: servobbb cleanup
This commit is contained in:
parent
18ea690072
commit
d16c010c3d
1 changed files with 3 additions and 3 deletions
|
@ -26,8 +26,8 @@ func main() {
|
||||||
|
|
||||||
servo := servo.New(pwm)
|
servo := servo.New(pwm)
|
||||||
|
|
||||||
c := make(chan os.Signal, 1)
|
quit := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, os.Interrupt, os.Kill)
|
signal.Notify(quit, os.Interrupt, os.Kill)
|
||||||
|
|
||||||
turnTimer := time.Tick(500 * time.Millisecond)
|
turnTimer := time.Tick(500 * time.Millisecond)
|
||||||
left := true
|
left := true
|
||||||
|
@ -47,7 +47,7 @@ func main() {
|
||||||
case false:
|
case false:
|
||||||
servo.SetAngle(110)
|
servo.SetAngle(110)
|
||||||
}
|
}
|
||||||
case <-c:
|
case <-quit:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue