1.2 KiB
1.2 KiB
Show Number
Show a number on the LED screen. It will slide left if it has more than one digit.
basic.showNumber(2, 150)
Parameters
value
is a Number.interval
is an optional Number. It means the number of milliseconds before sliding thevalue
left by one LED each time. Bigger intervals make the sliding slower.
Examples:
To show the number 10:
basic.showNumber(10)
To show the number stored in a variable:
let x = 1
basic.showNumber(x)
Example: count to 5
This example uses a for loop to show numbers 0
through 5
on the screen:
for (let i = 0; i < 6; i++) {
basic.showNumber(i)
basic.pause(200)
}
Other show functions
- Use show string to show a String with letters on the screen.
- Use show animation to show a group of pictures on the screen, one after another.