2016-03-26 00:47:20 +01:00
|
|
|
# Stop Animation
|
|
|
|
|
2016-07-09 01:34:56 +02:00
|
|
|
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()
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Example
|
2016-07-09 01:34:56 +02:00
|
|
|
|
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``.
|
2016-07-09 01:34:56 +02:00
|
|
|
|
|
|
|
```blocks
|
2020-03-19 16:26:40 +01:00
|
|
|
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
|
2016-07-09 01:34:56 +02:00
|
|
|
led.stopAnimation();
|
|
|
|
});
|
2016-07-28 21:16:18 +02:00
|
|
|
basic.showString("STOP ME! STOP ME! PLEASE, WON'T SOMEBODY STOP ME?");
|
|
|
|
```
|
2016-07-09 01:34:56 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## ~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.
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## ~
|
2016-07-28 21:16:18 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See Also
|
2016-07-09 01:34:56 +02:00
|
|
|
|
2016-07-28 21:16:18 +02:00
|
|
|
[show animation](/reference/basic/show-animation)
|