Update timing for LED Matrix usage

This commit is contained in:
Juri 2022-03-01 12:49:11 +01:00
parent 439996bd8c
commit 53574d2c88
5 changed files with 13 additions and 13 deletions

View File

@ -270,14 +270,14 @@
"basic.showCompass|param|interval": "the amount of time (milliseconds) to show the needle. Default is 600.", "basic.showCompass|param|interval": "the amount of time (milliseconds) to show the needle. Default is 600.",
"basic.showIcon": "Draws the selected icon on the LED screen", "basic.showIcon": "Draws the selected icon on the LED screen",
"basic.showIcon|param|icon": "the predefined icon id", "basic.showIcon|param|icon": "the predefined icon id",
"basic.showIcon|param|interval": "the amount of time (milliseconds) to show the icon. Default is 600.", "basic.showIcon|param|interval": "the amount of time (milliseconds) to block the LED Matrix for showing the icon. Default is 200.",
"basic.showLeds": "Draws an image on the LED screen.", "basic.showLeds": "Draws an image on the LED screen.",
"basic.showLeds|param|interval": "time in milliseconds to pause after drawing", "basic.showLeds|param|interval": "time in milliseconds to pause after drawing",
"basic.showLeds|param|leds": "the pattern of LED to turn on/off", "basic.showLeds|param|leds": "the pattern of LED to turn on/off",
"basic.showNumber": "Scroll a number on the screen. If the number fits on the screen (i.e. is a single digit), do not scroll.", "basic.showNumber": "Scroll a number on the screen. If the number fits on the screen (i.e. is a single digit), do not scroll.",
"basic.showNumber|param|interval": "speed of scroll; eg: 150, 100, 200, -100", "basic.showNumber|param|interval": "speed of scroll; eg: 50, 100, 150, 200",
"basic.showString": "Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll.", "basic.showString": "Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll.",
"basic.showString|param|interval": "how fast to shift characters; eg: 150, 100, 200, -100", "basic.showString|param|interval": "how fast to shift characters; eg: 50, 100, 150, 200",
"basic.showString|param|text": "the text to scroll on the screen, eg: \"hi!\"", "basic.showString|param|text": "the text to scroll on the screen, eg: \"hi!\"",
"basic.turnRgbLedOff": "Sets the color on the build-in LED. Set to 0 to turn off.", "basic.turnRgbLedOff": "Sets the color on the build-in LED. Set to 0 to turn off.",
"console": "Reading and writing data to the console output.", "console": "Reading and writing data to the console output.",

View File

@ -25,7 +25,7 @@ namespace basic {
/** /**
* Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll. * Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll.
* @param text the text to scroll on the screen, eg: "hi!" * @param text the text to scroll on the screen, eg: "hi!"
* @param interval how fast to shift characters; eg: 150, 100, 200, -100 * @param interval how fast to shift characters; eg: 50, 100, 150, 200
*/ */
//% help=basic/show-string //% help=basic/show-string
//% weight=100 blockGap=16 //% weight=100 blockGap=16
@ -35,9 +35,9 @@ namespace basic {
//% parts="ledmatrix" //% parts="ledmatrix"
//% text.shadowOptions.toString=true //% text.shadowOptions.toString=true
//% expandableArgumentMode="toggle" //% expandableArgumentMode="toggle"
//% interval.defl=150 //% interval.defl=80
//% group="LED matrix" //% group="LED matrix"
void showString(String text, int interval = 150) { void showString(String text, int interval = 80) {
if (interval <= 0) if (interval <= 0)
interval = 1; interval = 1;
int l = text ? text->getUTF8Size() : 0; int l = text ? text->getUTF8Size() : 0;

View File

@ -43,7 +43,7 @@ namespace basic {
/** /**
* Scroll a number on the screen. If the number fits on the screen (i.e. is a single digit), do not scroll. * Scroll a number on the screen. If the number fits on the screen (i.e. is a single digit), do not scroll.
* @param interval speed of scroll; eg: 150, 100, 200, -100 * @param interval speed of scroll; eg: 50, 100, 150, 200
*/ */
//% help=basic/show-number //% help=basic/show-number
//% weight=95 //% weight=95
@ -52,7 +52,7 @@ namespace basic {
//% async //% async
//% parts="ledmatrix" //% parts="ledmatrix"
//% expandableArgumentMode="toggle" //% expandableArgumentMode="toggle"
//% interval.defl=150 //% interval.defl=80
//% group="LED matrix" //% group="LED matrix"
export function showNumber(value: number, interval?: number) { export function showNumber(value: number, interval?: number) {
showString(Math.roundWithPrecision(value, 2).toString(), interval); showString(Math.roundWithPrecision(value, 2).toString(), interval);

View File

@ -97,7 +97,7 @@ namespace basic {
/** /**
* Draws the selected icon on the LED screen * Draws the selected icon on the LED screen
* @param icon the predefined icon id * @param icon the predefined icon id
* @param interval the amount of time (milliseconds) to show the icon. Default is 600. * @param interval the amount of time (milliseconds) to block the LED Matrix for showing the icon. Default is 200.
*/ */
//% weight=90 blockGap=8 //% weight=90 blockGap=8
//% blockId=basic_show_icon //% blockId=basic_show_icon
@ -109,9 +109,9 @@ namespace basic {
//% icon.fieldOptions.width="380" //% icon.fieldOptions.width="380"
//% icon.fieldOptions.maxRows=4 //% icon.fieldOptions.maxRows=4
//% expandableArgumentMode="toggle" //% expandableArgumentMode="toggle"
//% interval.defl=600 //% interval.defl=200
//% group="LED matrix" //% group="LED matrix"
export function showIcon(icon: IconNames, interval = 600) { export function showIcon(icon: IconNames, interval = 200) {
let res = images.iconImage(icon) let res = images.iconImage(icon)
res.showImage(0, interval) res.showImage(0, interval)
} }

View File

@ -149,7 +149,7 @@ declare namespace basic {
/** /**
* Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll. * Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll.
* @param text the text to scroll on the screen, eg: "hi!" * @param text the text to scroll on the screen, eg: "hi!"
* @param interval how fast to shift characters; eg: 150, 100, 200, -100 * @param interval how fast to shift characters; eg: 50, 100, 150, 200
*/ */
//% help=basic/show-string //% help=basic/show-string
//% weight=100 blockGap=16 //% weight=100 blockGap=16
@ -160,7 +160,7 @@ declare namespace basic {
//% text.shadowOptions.toString=true //% text.shadowOptions.toString=true
//% expandableArgumentMode="toggle" //% expandableArgumentMode="toggle"
//% //%
//% group="LED matrix" interval.defl=150 shim=basic::showString //% group="LED matrix" interval.defl=80 shim=basic::showString
function showString(text: string, interval?: int32): void; function showString(text: string, interval?: int32): void;
/** /**