1.2 KiB
1.2 KiB
Show Number
Show a number on the LED screen, one digit at a time (scrolling from left to right)
basic.showNumber(2, 150)
Parameters
- value - a Number
- (optional) interval (ms) - Number; the time (in milliseconds) before scrolling by one LED; the larger the number, the slower the scroll
~
To display the number 10:
basic.showNumber(10)
To display the number stored in the x
variable:
let x = 1
basic.showNumber(x)
Example: count to 5
This example uses a for loop to show numbers 1
through 5
on the screen:
for (let i = 0; i < 5; i++) {
basic.showNumber(i + 1)
basic.pause(200)
}
Other show functions
- use show string to show a string on the screen
- use show animation to show a series of images on the screen