animation
Create a built-in pixel animation to use when an animation is shown.
light.animation(0)
You have several animations to choose from. Pick the one you want to use.
Parameters
- kind: which animation to use:
comet: a shooting burst of lightrainbow: many colors pulsing aroundsparkle: bright lights flashing all overrunning lights: a sequence of lights movingtheater chase: theater lights moving alongcolor wipe: a wave of color
Returns
- the built-in animation information used by an animation operation.
Example
Show the sparkle aninmation for 2 seconds when the A button is pressed.
input.buttonA.onEvent(ButtonEvent.Click, () => {
light.showAnimation(light.animation(3), 2000)
})
See Also
circuit-playground