This commit is contained in:
Tom Ball 2017-05-12 14:01:19 -07:00
parent 00bf5e52d7
commit d5596d8a0a
2 changed files with 8 additions and 8 deletions

View File

@ -17,9 +17,8 @@ namespace basic {
//% async
//% parts="ledmatrix"
void showNumber(int value, int interval = 150) {
if (interval < 0)
return;
if (interval <= 0)
interval = 1;
ManagedString t(value);
if (value < 0 || value >= 10) {
uBit.display.scroll(t, interval);
@ -55,8 +54,8 @@ namespace basic {
//% blockId=device_print_message
//% parts="ledmatrix"
void showString(StringData *text, int interval = 150) {
if (interval < 0)
return;
if (interval <= 0)
interval = 1;
ManagedString s(text);
int l = s.length();
if (l == 0) {

View File

@ -234,15 +234,16 @@ namespace pxsim.ImageMethods {
namespace pxsim.basic {
export function showNumber(x: number, interval: number) {
if (interval < 0) return;
if (interval <= 0)
interval = 1;
let leds = createImageFromString(x.toString());
if (x < 0 || x >= 10) ImageMethods.scrollImage(leds, 1, interval);
else showLeds(leds, interval * 5);
}
export function showString(s: string, interval: number) {
if (interval < 0) return;
if (interval <= 0)
interval = 1;
if (s.length == 0) {
clearScreen();
pause(interval * 5);