Add setLights shadow block

This commit is contained in:
Sam El-Husseini
2017-08-07 10:19:38 -07:00
parent 17683033b1
commit 5e7af872b5
3 changed files with 16 additions and 3 deletions

View File

@@ -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;
}
}