Add setLights shadow block
This commit is contained in:
parent
17683033b1
commit
5e7af872b5
@ -20,6 +20,7 @@
|
|||||||
"input.remoteTopRight": "Remote top-right button.",
|
"input.remoteTopRight": "Remote top-right button.",
|
||||||
"output.createBuffer": "Create a new zero-initialized buffer.",
|
"output.createBuffer": "Create a new zero-initialized buffer.",
|
||||||
"output.createBuffer|param|size": "number of bytes in the buffer",
|
"output.createBuffer|param|size": "number of bytes in the buffer",
|
||||||
|
"output.getPattern": "Pattern block.",
|
||||||
"output.setLights": "Set lights.",
|
"output.setLights": "Set lights.",
|
||||||
"screen.clear": "Clear screen and reset font to normal.",
|
"screen.clear": "Clear screen and reset font to normal.",
|
||||||
"screen.doubleIcon": "Double size of an icon.",
|
"screen.doubleIcon": "Double size of an icon.",
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
"input.remoteTopLeft|block": "remote top-left",
|
"input.remoteTopLeft|block": "remote top-left",
|
||||||
"input.remoteTopRight|block": "remote top-right",
|
"input.remoteTopRight|block": "remote top-right",
|
||||||
"input|block": "input",
|
"input|block": "input",
|
||||||
"output.setLights|block": "set lights %pattern",
|
"output.getPattern|block": "%pattern",
|
||||||
|
"output.setLights|block": "set lights %pattern=led_pattern",
|
||||||
"output|block": "output",
|
"output|block": "output",
|
||||||
"screen|block": "screen",
|
"screen|block": "screen",
|
||||||
"serial|block": "serial",
|
"serial|block": "serial",
|
||||||
|
@ -216,8 +216,8 @@ namespace output {
|
|||||||
/**
|
/**
|
||||||
* Set lights.
|
* Set lights.
|
||||||
*/
|
*/
|
||||||
//% blockId=setLights block="set lights %pattern"
|
//% blockId=setLights block="set lights %pattern=led_pattern"
|
||||||
export function setLights(pattern: LightsPattern): void {
|
export function setLights(pattern: number): void {
|
||||||
if (currPattern === pattern)
|
if (currPattern === pattern)
|
||||||
return
|
return
|
||||||
currPattern = pattern
|
currPattern = pattern
|
||||||
@ -225,4 +225,15 @@ namespace output {
|
|||||||
cmd[0] = pattern + 48
|
cmd[0] = pattern + 48
|
||||||
input.internal.getBtnsMM().write(cmd)
|
input.internal.getBtnsMM().write(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pattern block.
|
||||||
|
*/
|
||||||
|
//% blockId=led_pattern block="%pattern"
|
||||||
|
//% shim=TD_ID colorSecondary="#6e9a36"
|
||||||
|
//% blockHidden=true
|
||||||
|
export function getPattern(pattern: LightsPattern): number {
|
||||||
|
return pattern;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user