From 7bdce37fd3f18e2712e18c4e2c64cac69af0aca1 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Sun, 19 Sep 2021 19:43:11 +0200 Subject: :boom: Introduce new UI based on svelte, and rewrite a lot of the node app and the NeoRuntime --- .../docs/Scripting/Examples/strandtest/index.html | 737 ++++++++++++++++++ public/docs/Scripting/SupportLib/index.html | 861 +++++++++++++++++++++ 2 files changed, 1598 insertions(+) create mode 100644 public/docs/Scripting/Examples/strandtest/index.html create mode 100644 public/docs/Scripting/SupportLib/index.html (limited to 'public/docs/Scripting') diff --git a/public/docs/Scripting/Examples/strandtest/index.html b/public/docs/Scripting/Examples/strandtest/index.html new file mode 100644 index 0000000..5a3a0a3 --- /dev/null +++ b/public/docs/Scripting/Examples/strandtest/index.html @@ -0,0 +1,737 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Strandtest - Luxcena Neo Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Skip to content + + + +
+ +
+ +
+ + + + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + +

Strandtest

+
+

This script just does some fancy patterns to show of the neopixels' capabilities. +Runs in an endless loop, take a look at the code to see what it does more +precisely.

+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
import LuxcenaNeo as neo  # Can be imported as LuxcenaNeo as well. but anything else and it will fail...
+import time
+
+def colorWipe(color, wait_ms=50):
+    """Wipe color across display a pixel at a time."""
+    for i in range(neo.strip.numPixels()):
+        neo.strip.setPixelColor(i, color)
+        neo.strip.show()
+        time.sleep(wait_ms/1000.0)
+
+def theaterChase(color, wait_ms=50, iterations=10):
+    """Movie theater light style chaser animation."""
+    for j in range(iterations):
+        for q in range(3):
+            for i in range(0, neo.strip.numPixels(), 3):
+                neo.strip.setPixelColor(i+q, color)
+            neo.strip.show()
+            time.sleep(wait_ms/1000.0)
+            for i in range(0, neo.strip.numPixels(), 3):
+                neo.strip.setPixelColor(i+q, 0)
+
+def wheel(pos):
+    """Generate rainbow colors across 0-255 positions."""
+    if pos < 85:
+        return neo.Color(pos * 3, 255 - pos * 3, 0)
+    elif pos < 170:
+        pos -= 85
+        return neo.Color(255 - pos * 3, 0, pos * 3)
+    else:
+        pos -= 170
+        return neo.Color(0, pos * 3, 255 - pos * 3)
+
+def rainbow(wait_ms=20, iterations=1):
+    """Draw rainbow that fades across all pixels at once."""
+    for j in range(256*iterations):
+        for i in range(neo.strip.numPixels()):
+            neo.strip.setPixelColor(i, wheel((i+j) & 255))
+        neo.strip.show()
+        time.sleep(wait_ms/1000.0)
+
+def rainbowCycle(wait_ms=20, iterations=5):
+    """Draw rainbow that uniformly distributes itself across all pixels."""
+    for j in range(256*iterations):
+        for i in range(strip.numPixels()):
+            neo,strip.setPixelColor(i, wheel(((i * 256 / neo.strip.numPixels()) + j) & 255))
+        neo.strip.show()
+        time.sleep(wait_ms/1000.0)
+
+def theaterChaseRainbow(wait_ms=50):
+    """Rainbow movie theater light style chaser animation."""
+    for j in range(256):
+        for q in range(3):
+            for i in range(0, neo.strip.numPixels(), 3):
+                neo.strip.setPixelColor(i+q, wheel((i+j) % 255))
+            neo.strip.show()
+            time.sleep(wait_ms/1000.0)
+            for i in range(0, neo.strip.numPixels(), 3):
+                neo.strip.setPixelColor(i+q, 0)
+
+
+class Main(neo.NeoBehaviour):
+
+    def onStart(self):
+        # Change the brightness of the strip
+        neo.strip.setBrightness(100)
+
+        # Do an endless loop with some default neopixel test patterns
+        while True:
+            colorWipe(neo.Color(255, 0, 0))  # Red wipe
+            colorWipe(neo.Color(0, 255, 0))  # Blue wipe
+            colorWipe(neo.Color(0, 0, 255))  # Green wipe
+
+            theaterChase(neo.Color(127, 127, 127))  # White theater chase
+            theaterChase(neo.Color(127,   0,   0))  # Red theater chase
+            theaterChase(neo.Color(  0,   0, 127))  # Blue theater chase
+
+            rainbow()
+            rainbowCycle()
+            theaterChaseRainbow()
+
+
+ + + + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/docs/Scripting/SupportLib/index.html b/public/docs/Scripting/SupportLib/index.html new file mode 100644 index 0000000..870452f --- /dev/null +++ b/public/docs/Scripting/SupportLib/index.html @@ -0,0 +1,861 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Support Library - Luxcena Neo Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Skip to content + + + +
+ +
+ +
+ + + + +
+
+ + +
+
+
+ +
+
+
+ + + + + +
+
+ + + +

Support Library

+
+

class Strip

+

This is the object you are refeering to when you want to do things with LED's. +You shouldn't have to do instantiate your own new strip-object as you can use the one +set up by the software itself. +
1
+2
+3
LuxcenaNeo.strip
+or
+neo.strip
+
+

+

Strip.show()

+

Display all the changes made to the LEDs, on the actual LEDs.

+

Strip.setPixelColor(n, color)

+

Set LED at position n to the provided 24-bit color value (in RGB order).

+

Strip.setPixelColorXY(x, y, color)

+

Set LED at position (x, y) in the defined matrix to the provided 24-bit color value (in RGB order).

+

Strip.setPixelColorRGB(n, red, green, blue, white = 0)

+

Set LED at position n to the provided red, green, and blue color. +Each color component should be a value from 0 to 255 (where 0 is the +lowest intensity and 255 is the highest intensity).

+

Strip.setPixelColorXYRGB(x, y, red, green, blue, white = 0)

+

Set LED at position (x, y) in the defined matrix to the provided red, green, and blue color. +Each color component should be a value from 0 to 255 (where 0 is the +lowest intensity and 255 is the highest intensity).

+

Strip.setSegmentColorRGB(segment, red, green, blue, white = 0)

+

Set a whole segment to the provided red, green and blue color. +Each color component should be a value from 0 to 255 (where 0 is the +lowest intensity and 255 is the highest intensity).

+

Strip.setBrightness(brightness)

+

Scale each LED in the buffer by the provided brightness. A brightness +of 0 is the darkest and 255 is the brightest.

+

Strip.getBrightness():

+

Get the brightness value for each LED in the buffer. A brightness +of 0 is the darkest and 255 is the brightest.

+

Strip.getPixels():

+

Return an object which allows access to the LED display data as if +it were a sequence of 24-bit RGB values.

+

Strip.numPixels():

+

Return the number of pixels in the display.

+

Strip.getPixelColor(n)

+

Get the 24-bit RGB color value for the LED at position n.

+
+

Color(red, green, blue, white = 0)

+

Convert the provided red, green, blue color to a 24-bit color value. +Each color component should be a value 0-255 where 0 is the lowest intensity +and 255 is the highest intensity.

+

hexColor(value)

+

Convert the provided hexadecimal color to a 24-bit color value.

+ + + + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3