Skip to content

Instantly share code, notes, and snippets.

@asukakenji
Last active October 11, 2016 21:11
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 asukakenji/573ea3a696ea2048a1e47ab614224604 to your computer and use it in GitHub Desktop.
Save asukakenji/573ea3a696ea2048a1e47ab614224604 to your computer and use it in GitHub Desktop.
func (bt *BlinkyTape) animation(p Pattern, repeat int, delay time.Duration) {
bt.status = Running
L:
for i := 0; repeat < 0 || i < repeat; i++ {
select {
case <-bt.stop:
break L
default:
go bt.playPattern(p, delay)
<-bt.next
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment