Displaying numbers on the micro:bit screen as on the soroban abacus. This allows the user to display a 5 digit number on the screen. It's also much faster than displaying normal number:
- Single digit number
basic.showNumber(9)
- takes about 760 ms
soroban.showNumber(9)
- takes about 1 ms - Multiple digits number (e.g. temperature)
basic.showNumber(25)
- takes about 2657 ms
soroban.showNumber(25)
- takes about 1 ms - Multiple digits number (e.g. Pi)
basic.showNumber(3.141)
- takes about 4458 ms
soroban.showNumber(3.141)
- takes about 1 ms
Soroban: https://en.wikipedia.org/wiki/Soroban
Representation of digits 0 - 9, minus and decimal separator on the micro:bit screen (- led is off, + led is on):
- - - - - + + + + + - -
- + + + + - + + + + - -
- - + + + - - + + + + -
- - - + + - - - + + - -
- - - - + - - - - + - +
0 1 2 3 4 5 6 7 8 9 - .
Displays number as on the soroban abacus.
soroban.showNumber(3.14)
number
- the numberalignment
- align to the given column, by default align rightrefresh
- specify whether the screen should be cleared before displaying number, by default true
soroban.showNumber(12345)
Copyright (C) 2021 Adam Orczyk
Licensed under the MIT License (MIT). See LICENSE file for more details.
- for PXT/microbit