App Lab Documentation

ledScreen.scrollNumber

Category:micro:bit

Creates a scrolling display of numbers using the LEDs on a continuous loop. Scroll will display from left to right.

Examples

You are number one

Displays the number 1 when you press the A Button

onBoardEvent(buttonA, "down", function() {
  ledScreen.scrollNumber(1);
});

Count Down and Up Timer

Using the A and B button create a timer that will count down from 9 and count up from 1

onBoardEvent(buttonA, "down", function() {
  ledScreen.scrollNumber(987654321);
});
onBoardEvent(buttonB, "down", function() {
  ledScreen.scrollNumber(123456789);
});

Syntax

ledscreen.scrollNumber(number)

Parameters

NameTypeRequired?Description
numberNumber

The number used will be displayed as the value shown in the LED scroll. If the number is too large to be seen at one time it will read left to right.

Tips

When used without an OnEvent block, the scroll will repeat

Only numbers can be used

Found a bug in the documentation? Let us know at support@code.org.