Add setLights shadow block
This commit is contained in:
		@@ -20,6 +20,7 @@
 | 
			
		||||
  "input.remoteTopRight": "Remote top-right button.",
 | 
			
		||||
  "output.createBuffer": "Create a new zero-initialized buffer.",
 | 
			
		||||
  "output.createBuffer|param|size": "number of bytes in the buffer",
 | 
			
		||||
  "output.getPattern": "Pattern block.",
 | 
			
		||||
  "output.setLights": "Set lights.",
 | 
			
		||||
  "screen.clear": "Clear screen and reset font to normal.",
 | 
			
		||||
  "screen.doubleIcon": "Double size of an icon.",
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,8 @@
 | 
			
		||||
  "input.remoteTopLeft|block": "remote top-left",
 | 
			
		||||
  "input.remoteTopRight|block": "remote top-right",
 | 
			
		||||
  "input|block": "input",
 | 
			
		||||
  "output.setLights|block": "set lights %pattern",
 | 
			
		||||
  "output.getPattern|block": "%pattern",
 | 
			
		||||
  "output.setLights|block": "set lights %pattern=led_pattern",
 | 
			
		||||
  "output|block": "output",
 | 
			
		||||
  "screen|block": "screen",
 | 
			
		||||
  "serial|block": "serial",
 | 
			
		||||
 
 | 
			
		||||
@@ -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