pxt-calliope/docs/reference/led/stop-animation.md

33 lines
646 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# Stop Animation
Stop the animation that is playing and any animations that are waiting to
play.
2016-03-26 00:47:20 +01:00
```sig
led.stopAnimation()
```
## Example
2016-07-28 21:16:18 +02:00
This program sets up the ``stop animation`` part of the program,
and then shows a string that you can stop with button ``B``.
```blocks
2020-08-19 22:03:58 +02:00
input.onButtonPressed(Button.B, () => {
led.stopAnimation();
});
2016-07-28 21:16:18 +02:00
basic.showString("STOP ME! STOP ME! PLEASE, WON'T SOMEBODY STOP ME?");
```
## ~hint
2016-07-28 21:16:18 +02:00
It's important to set up ``stop animation`` before showing the
animation, so the ``stop animation`` part of the program will be ready
to go.
## ~
2016-07-28 21:16:18 +02:00
## See Also
2016-07-28 21:16:18 +02:00
[show animation](/reference/basic/show-animation)