Last active
October 11, 2016 21:11
-
-
Save asukakenji/573ea3a696ea2048a1e47ab614224604 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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