Add setLights shadow block
This commit is contained in:
@@ -216,8 +216,8 @@ namespace output {
|
||||
/**
|
||||
* Set lights.
|
||||
*/
|
||||
//% blockId=setLights block="set lights %pattern"
|
||||
export function setLights(pattern: LightsPattern): void {
|
||||
//% blockId=setLights block="set lights %pattern=led_pattern"
|
||||
export function setLights(pattern: number): void {
|
||||
if (currPattern === pattern)
|
||||
return
|
||||
currPattern = pattern
|
||||
@@ -225,4 +225,15 @@ namespace output {
|
||||
cmd[0] = pattern + 48
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user