This commit is contained in:
Peli de Halleux 2019-09-03 15:00:46 -07:00
Родитель ddff2554f7
Коммит 9a932397c0
5 изменённых файлов: 219 добавлений и 1 удалений

Двоичные данные
docs/static/libs/light.png поставляемый Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 15 KiB

Просмотреть файл

@ -0,0 +1,124 @@
{
"NeoPixelMode": "Different modes for RGB or RGB+W NeoPixel strips",
"PhotonMode": "A determines the mode of the photon",
"light": "Functions to operate colored LEDs.\n\nFunctions to operate colored LEDs.",
"light.NeoPixelAnimation": "An animation of a NeoPixel",
"light.NeoPixelAnimation.createRenderer": "Creates an animator instance",
"light.NeoPixelAnimation.createRenderer|param|strip": "the strip to execute on",
"light.NeoPixelStrip": "A NeoPixel strip",
"light.NeoPixelStrip.brightness": "Get the brightness of the pixel strip.",
"light.NeoPixelStrip.buf": "Gets the underlying color buffer for the entire strip",
"light.NeoPixelStrip.buffered": "Gets a value indicated if the changes are buffered",
"light.NeoPixelStrip.clear": "Turn off all pixel LEDs.",
"light.NeoPixelStrip.graph": "Display a vertical bar graph based on the `value` and `high` value.\nIf `high` is 0, the chart gets adjusted automatically.",
"light.NeoPixelStrip.graph|param|high": "maximum value, 0 to autoscale",
"light.NeoPixelStrip.graph|param|value": "current value to plot",
"light.NeoPixelStrip.length": "Get the number of pixels on the strip",
"light.NeoPixelStrip.mode": "Gets the LED data layout mode",
"light.NeoPixelStrip.move": "Shift LEDs forward and clear with zeros.\nYou need to call ``show`` to make the changes visible.",
"light.NeoPixelStrip.move|param|offset": "number of pixels to shift forward, eg: 1",
"light.NeoPixelStrip.photonFlip": "Switch the direction of the photon pulse.",
"light.NeoPixelStrip.photonForward": "Move a photon effect along the pixel strip by a number of steps.",
"light.NeoPixelStrip.photonForward|param|steps": "number of steps (lights) to move, eg: 1",
"light.NeoPixelStrip.pixelColor": "Gets the pixel color.",
"light.NeoPixelStrip.pixelColor|param|pixeloffset": "position of the NeoPixel in the strip",
"light.NeoPixelStrip.range": "Create a range of pixels.",
"light.NeoPixelStrip.range|param|length": "number of pixels in the range, eg: 4",
"light.NeoPixelStrip.range|param|start": "offset in the NeoPixel strip to start the range",
"light.NeoPixelStrip.setAll": "Set all of the pixels on the strip to one RGB color.",
"light.NeoPixelStrip.setAll|param|rgb": "RGB color of the LED",
"light.NeoPixelStrip.setBrightness": "Set the brightness of the strip. This flag only applies to future operation.",
"light.NeoPixelStrip.setBrightness|param|brightness": "a measure of LED brightness in 0-255. eg: 20",
"light.NeoPixelStrip.setBuffered": "Enables or disables automatically calling show when a change is made",
"light.NeoPixelStrip.setBuffered|param|on": "call show whenever a light is modified",
"light.NeoPixelStrip.setGradient": "Sets a gradient between two colors",
"light.NeoPixelStrip.setGradient|param|endColor": "the end color",
"light.NeoPixelStrip.setGradient|param|startColor": "the start color",
"light.NeoPixelStrip.setLength": "Sets the number of LEDs on a strip",
"light.NeoPixelStrip.setMode": "Sets the color mode and clears the colors.",
"light.NeoPixelStrip.setMode|param|mode": "the kind of color encoding required by the programmable lights",
"light.NeoPixelStrip.setPhotonMode": "Set the photon mode to pen up, pen down, or eraser.",
"light.NeoPixelStrip.setPhotonMode|param|mode": "the desired mode",
"light.NeoPixelStrip.setPhotonPenColor": "Set the photon color.",
"light.NeoPixelStrip.setPhotonPenColor|param|color": "the color of the photon",
"light.NeoPixelStrip.setPhotonPenHue": "Sets the photon hue.",
"light.NeoPixelStrip.setPhotonPenHue|param|hue": "the hue of the photon color",
"light.NeoPixelStrip.setPhotonPosition": "Sets the photon position to a given light index",
"light.NeoPixelStrip.setPhotonPosition|param|index": "index of the light, if out of bound, the index is wrapped",
"light.NeoPixelStrip.setPixelBrightness": "Sets an individual pixel brightness",
"light.NeoPixelStrip.setPixelBrightness|param|index": "@param brightness ",
"light.NeoPixelStrip.setPixelColor": "Set the pixel to a given color.\nYou need to call ``show`` to make the changes visible.",
"light.NeoPixelStrip.setPixelColor|param|pixeloffset": "position of the NeoPixel in the strip",
"light.NeoPixelStrip.setPixelWhiteLED": "Set the white brightness of a pixel in a NeoPixel strip of RGB+W LEDs.\nThis only works for RGB+W NeoPixels.",
"light.NeoPixelStrip.setPixelWhiteLED|param|pixeloffset": "position of the LED in the strip",
"light.NeoPixelStrip.setPixelWhiteLED|param|white": "brightness of the white LED",
"light.NeoPixelStrip.show": "Make the strip show all the new changes for the pixels.",
"light.NeoPixelStrip.showAnimation": "Show an animation or queue an animation in the animation queue",
"light.NeoPixelStrip.showAnimationFrame": "Show a single animation frame.",
"light.NeoPixelStrip.showAnimationFrame|param|animation": "the animation to run",
"light.NeoPixelStrip.showAnimation|param|animation": "the animation to run",
"light.NeoPixelStrip.showAnimation|param|duration": "the duration to run in milliseconds, eg: 500",
"light.NeoPixelStrip.showColors": "Renders a pattern of colors on the strip",
"light.NeoPixelStrip.startBrightnessTransition": "Starts a brightness transition on the strip (and cancels any other running transition)",
"light.NeoPixelStrip.startBrightnessTransition|param|transition": "@param duration ",
"light.NeoPixelStrip.stopAllAnimations": "Stop the current animation and any other animations ready to show.",
"light.NeoPixelStrip.stopBrightnessTransition": "Stops any running brightness transition",
"light._animationPicker": "An animation that can be shown on a light strip",
"light._animationPicker|param|animation": "The animation type",
"light.animation": "Creates a builtin animation",
"light.animation|param|kind": "the type of animation",
"light.clear": "Turn off all pixel LEDs on the onboard strip.",
"light.colors": "Get the RGB value of a known color",
"light.createAPA102Strip": "Creates a strip of colored LEDs (APA102)",
"light.createNeoPixelStrip": "Creates a strip of colored LEDs (WS2812b)",
"light.createStrip": "Create a new programmable light strip.",
"light.createStrip|param|mode": "the light encoding mode for different LED strips, eg: NeoPixelMode.RGB_GRB",
"light.createStrip|param|numleds": "number of leds in the strip, eg: 30",
"light.createStrip|param|pin": "the pin where the strip is connected.",
"light.defaultStrip": "Gets the default light strip",
"light.fade": "Use color.fade instead",
"light.fade|param|brightness": "the amount of brightness to apply to the color, eg: 128",
"light.graph": "Display a vertical bar graph based on the `value` and `high` value.\nIf `high` is 0, the chart gets adjusted automatically.",
"light.graph|param|high": "maximum value, 0 to autoscale",
"light.graph|param|value": "current value to plot",
"light.hsv": "Convert an HSV (hue, saturation, value) color to RGB",
"light.hsv|param|hue": "value of the hue channel between 0 and 255. eg: 255",
"light.hsv|param|sat": "value of the saturation channel between 0 and 255. eg: 255",
"light.hsv|param|val": "value of the value channel between 0 and 255. eg: 255",
"light.onboardStrip": "Get the default light strip.",
"light.photonFlip": "Switch the direction of the photon pulse.",
"light.photonForward": "Move a photon effect along the pixel strip by a number of steps.",
"light.photonForward|param|steps": "number of steps (lights) to move, eg: 1",
"light.pixelColor": "Gets the pixel color at a given offset.",
"light.pixelColor|param|pixeloffset": "position of the NeoPixel in the strip",
"light.pixels": "Gets the default external light strip",
"light.range": "Create a range of pixels.",
"light.range|param|length": "number of pixels in the range, eg: 4",
"light.range|param|start": "offset in the NeoPixel strip to start the range",
"light.rgb": "Converts red, green, blue channels into a RGB color",
"light.rgb|param|blue": "value of the blue channel between 0 and 255. eg: 255",
"light.rgb|param|green": "value of the green channel between 0 and 255. eg: 255",
"light.rgb|param|red": "value of the red channel between 0 and 255. eg: 255",
"light.setAll": "Set all of the pixels on the strip to one RGB color.",
"light.setAll|param|rgb": "RGB color of the LED",
"light.setBrightness": "Set the brightness of the strip. This flag only applies to future operation.",
"light.setBrightness|param|brightness": "a measure of LED brightness in 0-255. eg: 20",
"light.setGradient": "Sets a gradient between two colors",
"light.setLength": "Sets the number of LEDS on the default light strip",
"light.setMode": "Sets the type of RGB light on the default strip",
"light.setPhotonMode": "Set the photon mode to pen up, pen down, or eraser.",
"light.setPhotonMode|param|mode": "the desired mode",
"light.setPhotonPenHue": "Set the photon color hue.",
"light.setPhotonPenHue|param|hue": "the color hue of the photon",
"light.setPhotonPosition": "Sets the photon position to a given light index",
"light.setPhotonPosition|param|index": "index of the light, if out of bound, the index is wrapped",
"light.setPixelColor": "Set the pixel to a given color.",
"light.setPixelColor|param|color": "RGB color of the LED",
"light.setPixelColor|param|pixeloffset": "position of the NeoPixel in the strip",
"light.showAnimation": "Show an animation or queue an animation in the animation queue",
"light.showAnimationFrame": "Show a single animation frame",
"light.showAnimationFrame|param|animation": "the animation to run, eg: light.rainbowAnimation",
"light.showAnimation|param|animation": "the animation to run, eg: light.rainbowAnimation",
"light.showAnimation|param|duration": "the duration to run in milliseconds, eg: 500",
"light.stopAllAnimations": "Stop the current animation and any other animations ready to show."
}

Просмотреть файл

@ -0,0 +1,86 @@
{
"LightAnimation.ColorWipe|block": "color wipe",
"LightAnimation.Comet|block": "comet",
"LightAnimation.Rainbow|block": "rainbow",
"LightAnimation.RunningLights|block": "running lights",
"LightAnimation.Sparkle|block": "sparkle",
"LightAnimation.TheaterChase|block": "theater chase",
"LightMove.Rotate|block": "rotate",
"LightMove.Shift|block": "shift",
"NeoPixelMode.APA102|block": "APA102",
"NeoPixelMode.RGBW|block": "RGB+W",
"NeoPixelMode.RGB_RGB|block": "RGB (RGB format)",
"NeoPixelMode.RGB|block": "RGB (GRB format)",
"PhotonMode.Eraser|block": "eraser",
"PhotonMode.Off|block": "off",
"PhotonMode.PenDown|block": "pen down",
"PhotonMode.PenUp|block": "pen up",
"light.NeoPixelStrip.brightness|block": "%strip|brightness",
"light.NeoPixelStrip.clear|block": "%strip|clear",
"light.NeoPixelStrip.graph|block": "%strip|graph %value||up to %high",
"light.NeoPixelStrip.length|block": "%strip|length",
"light.NeoPixelStrip.move|block": "%strip|%kind=MoveKind|by %offset",
"light.NeoPixelStrip.photonFlip|block": "%strip|photon flip",
"light.NeoPixelStrip.photonForward|block": "%strip|photon forward by %steps",
"light.NeoPixelStrip.pixelColor|block": "%strip|pixel color at %pixeloffset",
"light.NeoPixelStrip.range|block": "%strip|range from %start|with %length|pixels",
"light.NeoPixelStrip.setAll|block": "set %strip all pixels to %rgb=colorNumberPicker",
"light.NeoPixelStrip.setBrightness|block": "set %strip brightness %brightness",
"light.NeoPixelStrip.setBuffered|block": "set %strip buffered %on",
"light.NeoPixelStrip.setGradient|block": "set %strip gradient from %startColor=colorNumberPicker to %endColor=colorNumberPicker",
"light.NeoPixelStrip.setLength|block": "set %strip length to %length pixels",
"light.NeoPixelStrip.setMode|block": "set %strip mode to %mode",
"light.NeoPixelStrip.setPhotonMode|block": "%strip|photon %mode",
"light.NeoPixelStrip.setPhotonPenColor|block": "%strip=variables_get|photon set pen color %color=colorNumberPicker",
"light.NeoPixelStrip.setPhotonPenHue|block": "%strip=variables_get|photon set pen hue %hue=colorWheelHsvPicker",
"light.NeoPixelStrip.setPhotonPosition|block": "%strip|photon set position %index",
"light.NeoPixelStrip.setPixelColor|block": "set %strip pixel color at %pixeloffset|to %rgb=colorNumberPicker",
"light.NeoPixelStrip.setPixelWhiteLED|block": "set %strip pixel white LED at %pixeloffset|to %white",
"light.NeoPixelStrip.showAnimationFrame|block": "%strip|show frame of %animation=light_animation_picker|animation",
"light.NeoPixelStrip.showAnimation|block": "%strip|show animation %animation=light_animation_picker|for %duration=timePicker|ms",
"light.NeoPixelStrip.show|block": "%strip|show",
"light.NeoPixelStrip.stopAllAnimations|block": "%strip|stop all animations",
"light._animationPicker|block": "%animation",
"light.animation|block": "%kind",
"light.clear|block": "clear",
"light.colorWipeAnimation|block": "color wipe",
"light.colors|block": "%color",
"light.cometAnimation|block": "comet",
"light.createAPA102Strip|block": "create APA102 strip|data %data|clock %clk|with %numleds pixels",
"light.createNeoPixelStrip|block": "create WS2812 strip|pin %pin|with %numleds pixels",
"light.createStrip|block": "create WS2812 strip on %pin with %numleds pixels",
"light.defaultStrip|block": "default strip",
"light.fade|block": "fade %color=neopixel_colors|by %brightness",
"light.graph|block": "graph %value||up to %high",
"light.hsv|block": "hue %hue|sat %sat|val %val",
"light.onboardStrip|block": "onboard strip",
"light.photonFlip|block": "photon flip",
"light.photonForward|block": "photon forward by %steps",
"light.pixelColor|block": "pixel color at %pixeloffset",
"light.rainbowAnimation|block": "rainbow",
"light.range|block": "range from %start|with %length|pixels",
"light.rgb|block": "red %red|green %green|blue %blue",
"light.runningLightsAnimation|block": "running lights",
"light.setAll|block": "set all pixels to %rgb=colorNumberPicker",
"light.setBrightness|block": "set brightness %brightness",
"light.setGradient|block": "set gradient from %startRgb=colorNumberPicker to %endRgb=colorNumberPicker",
"light.setLength|block": "set pixels length to %numleds pixels",
"light.setMode|block": "set default strip mode to %mode",
"light.setPhotonMode|block": "photon %mode",
"light.setPhotonPenHue|block": "photon set pen hue %hue=colorWheelHsvPicker",
"light.setPhotonPosition|block": "photon set position %index",
"light.setPixelColor|block": "set pixel color at %pixeloffset|to %rgb=colorNumberPicker",
"light.showAnimationFrame|block": "show frame of %animation=light_animation_picker|animation",
"light.showAnimation|block": "show animation %animation=light_animation_picker|for %duration=timePicker|ms",
"light.sparkleAnimation|block": "sparkle",
"light.stopAllAnimations|block": "stop all animations",
"light.theaterChaseAnimation|block": "theater chase",
"light|block": "light",
"{id:category}Easing": "Easing",
"{id:category}Jacdac": "Jacdac",
"{id:category}Light": "Light",
"{id:group}Color": "Color",
"{id:group}Configuration": "Configuration",
"{id:group}More": "More",
"{id:group}Photon": "Photon"
}

7
libs/light/pxt.json Normal file
Просмотреть файл

@ -0,0 +1,7 @@
{
"additionalFilePath": "../../node_modules/pxt-common-packages/libs/light",
"public": true,
"dependencies": {
"core": "file:../core"
}
}

Просмотреть файл

@ -11,7 +11,8 @@
"libs/devices",
"libs/bluetooth",
"libs/servo",
"libs/radio-broadcast"
"libs/radio-broadcast",
"libs/light"
],
"cloud": {
"workspace": false,