Jump to content

microbit.display.animateAsync

From Compy Docs

Display an animation on the LED matrix. This is a non-blocking function, returning immediately.

Function

Synopsis

microbit.display.animateAsync(image, delay, stride)

Arguments

  • `image` — An image table with `width`, `height` and `data` fields.
  • `delay` — A number. The delay between animation frames in milliseconds.
  • `stride` — The number of pixels by which the display window is moving across the image.

Returns

A boolean value. True on success.

Synopsis

microbit.display.animateAsync(image, delay, stride, startingPosition)

Arguments

  • `image` — An image table with `width`, `height` and `data` fields.
  • `delay` — A number. The delay between animation frames in milliseconds.
  • `stride` — The number of pixels by which the display window is moving across the image.
  • `startingPosition` — The number of pixels to skip before starting the animation.

Returns

A boolean value. True on success.

Synopsis

microbit.display.animateAsync(image, delay, stride, startingPosition, autoClear)

Arguments

  • `image` — An image table with `width`, `height` and `data` fields.
  • `delay` — A number. The delay between animation frames in milliseconds.
  • `stride` — The number of pixels by which the display window is moving across the image.
  • `startingPosition` — The number of pixels to skip before starting the animation.
  • `autoClear` — A boolean value. True if the display is to be cleared after finishing the animation, false if the last frame is to be retained on the display.

Returns

A boolean value. True on success.

See Also