|
PixelKey
NeoPixel USB Key
|
Keyframes are the instructions for how the NeoPixels are controlled and change state. Each keyframe is separated by either a newline or a semi-colon. Special keyframes modifiers can also be used and are separated the same as with keyframes. Keyframe modifiers add additional control variables to a keyframe.
Changes the color of a NeoPixel to a constant value.
Blinks a NeoPixel with a specified period and duty-cycle between two values. The NeoPixel color will be set to color 2 after completion of the blink keyframe. This will repeat until the next keyframe is received unless otherwise specified with a repeat modifier.
where
Transitions a NeoPixel between a list of colors over a specified time period. The NeoPixel color will be set to the last color after completion of the fade keyframe.
where
period/(len(colors)-1). Otherwise, the transition keyframe will use the specified function once across the entire transition.period/(len(colors)-1) seconds.cubic(0,0,1,1)]. (default)cubic(0.25,0.1,0.25,1)].cubic(0.42,0,1,1)].cubic(0,0,0.58,1)].cubic(0,42,0,0.58,1)].In cases where the transition occurs between all colors entirely, i.e. no + transition prefix, the colors are equally spaced across the transition curve. So if one uses fade 10 red,green,blue ease-in, it will quickly transition from red towards green, then slowly transition from green to blue all over 10 seconds. Whereas, if one uses fade 10 red,green,blue +ease-in, it will perform two transitions over 5 seconds each. This is equivalent to fade 5 red,green ease-in; fade 5 green,blue ease-in.
For non-pure color transitions, e.g. red to white, each color component will be transitioned separately in the HSV color space.
Keyframe modifiers perform additional operations beyond that of specifying a NeoPixel state, e.g. grouping or repeating.
Please note, the order of keyframe modifiers matter. ^5; @PT10M; is not the same as @PT10M; ^5;. The former meaning to repeat every 10 minutes for a total of 5 times, while the latter represents in 10 minutes immediately repeat the keyframe 5 times. When in doubt, use keyframe groups.
Keyframes may be repeated by sending a repeat modifier before the desired repeating keyframe. A repeat modifier is a carrot, "`^`", followed by a count. A blank count or a count of "0" indicates repeat indefinitely or until the next keyframe is ready.
For example, to repeat a blink keyframe 10 times:
or in-line
Keyframes may be queued for a specific time, which can be used to synchronize multiple devices.
A scheduled modifier is an at symbol, "`@`", followed by a time string in ISO-8601 format. Date/time literals and durations are supported.
The following ISO-8601 representations are allowed for the schedule:
YYYYMMDD, YYYY-MM-DD00:00 or midnight in the morning.THHmmss.sss, THH:mm:ss.sssYYYYMMDDTHHmmss.sss, YYYY-MM-DDTHH:mm:ss.sssPnYnMnDTnHnMnSPT30M.<start>/<end>, <start>/<duration>, <duration>/<end>Rn/<interval or duration>~~n is not specified, it will repeat indefinitely until stopped.For example, to start a keyframe at 1:42 p.m. on 22 Oct 2023:
or in-line
📝Note: The repeating modifier may be combined with duration based timestamps. It is not valid with absolute timestamps and will be ignored.
Keyframes may be grouped together and optionally named. Please note, the name has no effect other than as information for the user.
Groups are started by using a pound symbol, "`#`", and groups are ended by a pound symbol followed by a forward-slash, "`#/`". A list of indexes may follow the pound symbol for group starts to override the default index list. Groups may be nested.
Up to 16 keyframes or child groups can be added to a group.
📝Note: The NeoPixel states will not update until all groups have been closed with a
#/. At which point, the group keyframes will be executed.
For example, to blink NeoPixels 2 and 3 blue 5 times then rotate through all colors over 5 seconds:
or in-line
📝Note: Repeat and timestamp modifiers may be applied to groups.
Colors can be specified in different formats:
RGB values can be specified as hexadecimal values, #RRGGBB, or as a tuple of percentages, rrr,ggg,bbb where values can range from 0-100. For example, an orange can be specified as #ED7651 or %93,46,32.
HSV, hue-saturation-value, can be specified by a tuple of values prefixed with an exclamation point, !hhh,sss,vvv. Hue ranges from 0-359 with pure red at 0, pure green at 120, and pure blue at 240. Saturation and value range from 0-100. For example, the same orange as above can be represented as !14,66,93.
ℹ️ Two short-forms are allowed:
!hhh,vvv: represents a pure hue at a variable brightness!hhh: represents a pure hue at full brightness
📝Note: HSV is used for the internal representation for all operations as it most closely resembles the range and operation of an RBG light. It also provides easy methods to transition in a way most familiar to human viewers. Value controls how "on" the light is (0 is off, 100 is fully powered). Saturation controls how pure the color is (0 is white, 100 is pure hue). Lastly, hue controls which two LEDs are primarily mixed (0 is red, 120 is green, 240 is blue, with 360 also being red).
HSL, hue-saturation-lightness, values can be specified by a tuple of values prefixed with a double exclamation point, !!hhh,sss,lll. Hue ranges from 0-359 with pure red at 0, pure green at 120, and pure blue at 240. Saturation and lightness range from 0-100. For example, the same orange as above can be represented as !!14,82,62.
These named colors are available:
| Name | RGB | HSV |
|---|---|---|
| red | #FF0000 | !0,100,100 |
| orange | #FF7F00 | !30,100,100 |
| yellow | #FFFF00 | !60,100,100 |
| neon | #7FFF00 | !90,100,100 |
| green | #00FF00 | !120,100,100 |
| seafoam | #00FF7F | !150,100,100 |
| cyan | #00FFFF | !180,100,100 |
| lightblue | #007FFF | !210,100,100 |
| blue | #0000FF | !240,100,100 |
| purple | #7F00FF | !270,100,100 |
| magenta | #FF00FF | !300,100,100 |
| pink | #FF007F | !330,100,100 |
| white | #FFFFFF | !0,0,100 |
| black/off | #000000 | !0,0,0 |
📝Note: Since NeoPixels are purely emissive sources of light, no blacks are possible. Therefore, many colors will not be able to be accurately represented. For instance, grays are not possible since it will just be a dim, pure white instead.
For all color specifications, leading zeros are permitted for decimal values and upper- or lower-case letters may be used for hexadecimal values.