fastled 1.1.24__tar.gz → 1.1.26__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/build_multi_docker_image.yml +142 -107
  2. {fastled-1.1.24 → fastled-1.1.26}/PKG-INFO +6 -2
  3. {fastled-1.1.24 → fastled-1.1.26}/README.md +5 -1
  4. {fastled-1.1.24 → fastled-1.1.26}/examples/wasm/wasm.ino +138 -131
  5. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/__init__.py +1 -1
  6. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/app.py +3 -2
  7. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/client_server.py +9 -3
  8. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/compile_server.py +31 -16
  9. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/docker_manager.py +53 -3
  10. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/select_sketch_directory.py +1 -1
  11. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/string_diff.py +15 -9
  12. {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/PKG-INFO +6 -2
  13. {fastled-1.1.24 → fastled-1.1.26}/tests/test_ino/bad/bad.ino +1 -1
  14. {fastled-1.1.24/tests/test_ino/wasm → fastled-1.1.26/tests/test_ino/embedded}/wasm.ino +1 -1
  15. {fastled-1.1.24/tests/test_ino/embedded → fastled-1.1.26/tests/test_ino/wasm}/wasm.ino +134 -134
  16. {fastled-1.1.24 → fastled-1.1.26}/.aiderignore +0 -0
  17. {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/lint.yml +0 -0
  18. {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/test_macos.yml +0 -0
  19. {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/test_ubuntu.yml +0 -0
  20. {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/test_win.yml +0 -0
  21. {fastled-1.1.24 → fastled-1.1.26}/.gitignore +0 -0
  22. {fastled-1.1.24 → fastled-1.1.26}/.pylintrc +0 -0
  23. {fastled-1.1.24 → fastled-1.1.26}/.vscode/launch.json +0 -0
  24. {fastled-1.1.24 → fastled-1.1.26}/.vscode/settings.json +0 -0
  25. {fastled-1.1.24 → fastled-1.1.26}/.vscode/tasks.json +0 -0
  26. {fastled-1.1.24 → fastled-1.1.26}/LICENSE +0 -0
  27. {fastled-1.1.24 → fastled-1.1.26}/MANIFEST.in +0 -0
  28. {fastled-1.1.24 → fastled-1.1.26}/clean +0 -0
  29. {fastled-1.1.24 → fastled-1.1.26}/docs/fastled.js +0 -0
  30. {fastled-1.1.24 → fastled-1.1.26}/docs/fastled.wasm +0 -0
  31. {fastled-1.1.24 → fastled-1.1.26}/docs/index.css +0 -0
  32. {fastled-1.1.24 → fastled-1.1.26}/docs/index.html +0 -0
  33. {fastled-1.1.24 → fastled-1.1.26}/docs/index.js +0 -0
  34. {fastled-1.1.24 → fastled-1.1.26}/examples/Blink/Blink.ino +0 -0
  35. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/Chromancer.ino +0 -0
  36. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/detail.h +0 -0
  37. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/gary_woos_wled_port/gary_woos_wled_ledmap.h +0 -0
  38. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/gary_woos_wled_port/presets.json +0 -0
  39. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/gary_woos_wled_port/presets.min.json +0 -0
  40. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/gen.py +0 -0
  41. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/mapping.h +0 -0
  42. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/net.h +0 -0
  43. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/output.json +0 -0
  44. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/ripple.h +0 -0
  45. {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/screenmap.json.h +0 -0
  46. {fastled-1.1.24 → fastled-1.1.26}/examples/ColorPalette/ColorPalette.ino +0 -0
  47. {fastled-1.1.24 → fastled-1.1.26}/examples/ColorTemperature/ColorTemperature.ino +0 -0
  48. {fastled-1.1.24 → fastled-1.1.26}/examples/Cylon/Cylon.ino +0 -0
  49. {fastled-1.1.24 → fastled-1.1.26}/examples/DemoReel100/DemoReel100.ino +0 -0
  50. {fastled-1.1.24 → fastled-1.1.26}/examples/Esp32Rmt51/Esp32Rmt51.ino +0 -0
  51. {fastled-1.1.24 → fastled-1.1.26}/examples/EspI2SDemo/EspI2SDemo.ino +0 -0
  52. {fastled-1.1.24 → fastled-1.1.26}/examples/Fire2012/Fire2012.ino +0 -0
  53. {fastled-1.1.24 → fastled-1.1.26}/examples/Fire2012WithPalette/Fire2012WithPalette.ino +0 -0
  54. {fastled-1.1.24 → fastled-1.1.26}/examples/FirstLight/FirstLight.ino +0 -0
  55. {fastled-1.1.24 → fastled-1.1.26}/examples/FxEngine/FxEngine.ino +0 -0
  56. {fastled-1.1.24 → fastled-1.1.26}/examples/Noise/Noise.ino +0 -0
  57. {fastled-1.1.24 → fastled-1.1.26}/examples/NoisePlayground/NoisePlayground.ino +0 -0
  58. {fastled-1.1.24 → fastled-1.1.26}/examples/NoisePlusPalette/NoisePlusPalette.ino +0 -0
  59. {fastled-1.1.24 → fastled-1.1.26}/examples/OctoWS2811/OctoWS2811.ino +0 -0
  60. {fastled-1.1.24 → fastled-1.1.26}/examples/Pacifica/Pacifica.ino +0 -0
  61. {fastled-1.1.24 → fastled-1.1.26}/examples/Pride2015/Pride2015.ino +0 -0
  62. {fastled-1.1.24 → fastled-1.1.26}/examples/SdCard/SdCard.ino +0 -0
  63. {fastled-1.1.24 → fastled-1.1.26}/examples/SdCard/screenmap.json.h +0 -0
  64. {fastled-1.1.24 → fastled-1.1.26}/examples/TwinkleFox/TwinkleFox.ino +0 -0
  65. {fastled-1.1.24 → fastled-1.1.26}/examples/Video/Gfx2Video/Gfx2Video.ino +0 -0
  66. {fastled-1.1.24 → fastled-1.1.26}/examples/WasmScreenCoords/WasmScreenCoords.ino +0 -0
  67. {fastled-1.1.24 → fastled-1.1.26}/examples/Water/Water.ino +0 -0
  68. {fastled-1.1.24 → fastled-1.1.26}/examples/XYMatrix/XYMatrix.ino +0 -0
  69. {fastled-1.1.24 → fastled-1.1.26}/install +0 -0
  70. {fastled-1.1.24 → fastled-1.1.26}/lint +0 -0
  71. {fastled-1.1.24 → fastled-1.1.26}/pyproject.toml +0 -0
  72. {fastled-1.1.24 → fastled-1.1.26}/requirements.testing.txt +0 -0
  73. {fastled-1.1.24 → fastled-1.1.26}/setup.cfg +0 -0
  74. {fastled-1.1.24 → fastled-1.1.26}/setup.py +0 -0
  75. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/assets/example.txt +0 -0
  76. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/build_mode.py +0 -0
  77. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/cli.py +0 -0
  78. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/env.py +0 -0
  79. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/filewatcher.py +0 -0
  80. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/keyboard.py +0 -0
  81. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/open_browser.py +0 -0
  82. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/paths.py +0 -0
  83. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/sketch.py +0 -0
  84. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/spinner.py +0 -0
  85. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/types.py +0 -0
  86. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/util.py +0 -0
  87. {fastled-1.1.24 → fastled-1.1.26}/src/fastled/web_compile.py +0 -0
  88. {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/SOURCES.txt +0 -0
  89. {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/dependency_links.txt +0 -0
  90. {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/entry_points.txt +0 -0
  91. {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/requires.txt +0 -0
  92. {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/top_level.txt +0 -0
  93. {fastled-1.1.24 → fastled-1.1.26}/test +0 -0
  94. {fastled-1.1.24 → fastled-1.1.26}/tests/test_bad_ino.py +0 -0
  95. {fastled-1.1.24 → fastled-1.1.26}/tests/test_cli.py +0 -0
  96. {fastled-1.1.24 → fastled-1.1.26}/tests/test_compile_server.py +0 -0
  97. {fastled-1.1.24 → fastled-1.1.26}/tests/test_embedded_data.py +0 -0
  98. {fastled-1.1.24 → fastled-1.1.26}/tests/test_filechanger.py +0 -0
  99. {fastled-1.1.24 → fastled-1.1.26}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  100. {fastled-1.1.24 → fastled-1.1.26}/tests/test_server_and_client_seperatly.py +0 -0
  101. {fastled-1.1.24 → fastled-1.1.26}/tests/test_webcompile.py +0 -0
  102. {fastled-1.1.24 → fastled-1.1.26}/upload_package.sh +0 -0
@@ -1,107 +1,142 @@
1
- name: Build and Push Multi Docker Image
2
-
3
- on:
4
- push:
5
- branches:
6
- - main # Adjust this to your default branch
7
- schedule:
8
- - cron: '0 12 * * *' # Executes every day at 4:00 AM Pacific Time
9
-
10
- env:
11
- REGISTRY_IMAGE: niteris/fastled-wasm # Replace with your Docker Hub username and repository
12
-
13
- jobs:
14
- build:
15
- runs-on: ubuntu-latest
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- platform:
20
- - linux/amd64
21
- - linux/arm64
22
- steps:
23
- - name: Prepare
24
- run: |
25
- platform=${{ matrix.platform }}
26
- echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
27
- - name: Docker meta
28
- id: meta
29
- uses: docker/metadata-action@v5
30
- with:
31
- images: ${{ env.REGISTRY_IMAGE }}
32
- - name: Set up QEMU
33
- uses: docker/setup-qemu-action@v3
34
- - name: Set up Docker Buildx
35
- uses: docker/setup-buildx-action@v3
36
- - name: Login to Docker Hub
37
- uses: docker/login-action@v3
38
- with:
39
- username: ${{ secrets.DOCKER_USERNAME }}
40
- password: ${{ secrets.DOCKER_PASSWORD }}
41
- - name: Build and push by digest
42
- id: build
43
- uses: docker/build-push-action@v6
44
- with:
45
- platforms: ${{ matrix.platform }}
46
- context: https://github.com/fastled/fastled.git
47
- file: src/platforms/wasm/compiler/Dockerfile
48
- labels: ${{ steps.meta.outputs.labels }}
49
- outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
50
- build-args: |
51
- PLATFORM_TAG=${{ matrix.platform == 'linux/arm64' && '-arm64' || '' }}
52
- cache-from: type=gha
53
- cache-to: type=gha,mode=max,compression=zstd
54
- - name: Export digest
55
- run: |
56
- mkdir -p /tmp/digests
57
- digest="${{ steps.build.outputs.digest }}"
58
- touch "/tmp/digests/${digest#sha256:}"
59
- - name: Upload digest
60
- uses: actions/upload-artifact@v4
61
- with:
62
- name: digests-${{ env.PLATFORM_PAIR }}
63
- path: /tmp/digests/*
64
- if-no-files-found: error
65
- retention-days: 1
66
-
67
- merge:
68
- runs-on: ubuntu-latest
69
- needs:
70
- - build
71
- steps:
72
- - name: Download digests
73
- uses: actions/download-artifact@v4
74
- with:
75
- path: /tmp/digests
76
- pattern: digests-*
77
- merge-multiple: true
78
-
79
- - name: Set up Docker Buildx
80
- uses: docker/setup-buildx-action@v3
81
-
82
- - name: Docker meta
83
- id: meta
84
- uses: docker/metadata-action@v5
85
- with:
86
- images: ${{ env.REGISTRY_IMAGE }}
87
-
88
- - name: Login to Docker Hub
89
- uses: docker/login-action@v3
90
- with:
91
- username: ${{ secrets.DOCKER_USERNAME }}
92
- password: ${{ secrets.DOCKER_PASSWORD }}
93
-
94
- - name: Create manifest list and push
95
- working-directory: /tmp/digests
96
- run: |
97
- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
98
- $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
99
-
100
- - name: Inspect image
101
- run: |
102
- docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
103
-
104
- - name: Redeploy FastLED web service
105
- run: |
106
- curl ${{ secrets.FASTLED_REDEPLOY_URL }}
107
-
1
+ name: Build and Push Multi Docker Image
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main # Adjust this to your default branch
7
+ schedule:
8
+ - cron: '0 12 * * *' # Executes every day at 4:00 AM Pacific Time
9
+
10
+ env:
11
+ REGISTRY_IMAGE: niteris/fastled-wasm # Replace with your Docker Hub username and repository
12
+
13
+ jobs:
14
+ check-if-changed:
15
+ runs-on: ubuntu-latest
16
+ outputs:
17
+ should_run: ${{ steps.check.outputs.should_run }}
18
+ steps:
19
+ - name: Check workflow repo changes
20
+ uses: actions/checkout@v4
21
+ with:
22
+ fetch-depth: 2
23
+ - name: Check FastLED repo
24
+ uses: actions/checkout@v4
25
+ with:
26
+ repository: fastled/fastled
27
+ path: fastled
28
+ - id: check
29
+ run: |
30
+ # Check if there are any changes in workflow repository
31
+ WORKFLOW_CHANGED=$(git diff --quiet HEAD^1 HEAD || echo "changed")
32
+
33
+ # Check FastLED repo for changes in last 24 hours
34
+ cd fastled
35
+ FASTLED_CHANGED=$(git log --since="24 hours ago" --oneline | wc -l)
36
+
37
+ if [[ -n "$WORKFLOW_CHANGED" ]] || [[ "$FASTLED_CHANGED" -gt 0 ]]; then
38
+ echo "Changes detected in workflow repository or FastLED in last 24h"
39
+ echo "should_run=true" >> $GITHUB_OUTPUT
40
+ else
41
+ echo "No recent changes detected"
42
+ echo "should_run=false" >> $GITHUB_OUTPUT
43
+ fi
44
+
45
+ build:
46
+ needs: check-if-changed
47
+ if: needs.check-if-changed.outputs.should_run == 'true'
48
+ runs-on: ubuntu-latest
49
+ strategy:
50
+ fail-fast: false
51
+ matrix:
52
+ platform:
53
+ - linux/amd64
54
+ - linux/arm64
55
+ steps:
56
+ - name: Prepare
57
+ run: |
58
+ platform=${{ matrix.platform }}
59
+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
60
+ - name: Docker meta
61
+ id: meta
62
+ uses: docker/metadata-action@v5
63
+ with:
64
+ images: ${{ env.REGISTRY_IMAGE }}
65
+ - name: Set up QEMU
66
+ uses: docker/setup-qemu-action@v3
67
+ - name: Set up Docker Buildx
68
+ uses: docker/setup-buildx-action@v3
69
+ - name: Login to Docker Hub
70
+ uses: docker/login-action@v3
71
+ with:
72
+ username: ${{ secrets.DOCKER_USERNAME }}
73
+ password: ${{ secrets.DOCKER_PASSWORD }}
74
+ - name: Build and push by digest
75
+ id: build
76
+ uses: docker/build-push-action@v6
77
+ with:
78
+ platforms: ${{ matrix.platform }}
79
+ context: https://github.com/fastled/fastled.git
80
+ file: src/platforms/wasm/compiler/Dockerfile
81
+ labels: ${{ steps.meta.outputs.labels }}
82
+ outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
83
+ build-args: |
84
+ PLATFORM_TAG=${{ matrix.platform == 'linux/arm64' && '-arm64' || '' }}
85
+ cache-from: type=gha
86
+ cache-to: type=gha,mode=max,compression=zstd
87
+ - name: Export digest
88
+ run: |
89
+ mkdir -p /tmp/digests
90
+ digest="${{ steps.build.outputs.digest }}"
91
+ touch "/tmp/digests/${digest#sha256:}"
92
+ - name: Upload digest
93
+ uses: actions/upload-artifact@v4
94
+ with:
95
+ name: digests-${{ env.PLATFORM_PAIR }}
96
+ path: /tmp/digests/*
97
+ if-no-files-found: error
98
+ retention-days: 1
99
+
100
+ merge:
101
+ runs-on: ubuntu-latest
102
+ needs:
103
+ - check-if-changed
104
+ - build
105
+ if: needs.check-if-changed.outputs.should_run == 'true'
106
+ steps:
107
+ - name: Download digests
108
+ uses: actions/download-artifact@v4
109
+ with:
110
+ path: /tmp/digests
111
+ pattern: digests-*
112
+ merge-multiple: true
113
+
114
+ - name: Set up Docker Buildx
115
+ uses: docker/setup-buildx-action@v3
116
+
117
+ - name: Docker meta
118
+ id: meta
119
+ uses: docker/metadata-action@v5
120
+ with:
121
+ images: ${{ env.REGISTRY_IMAGE }}
122
+
123
+ - name: Login to Docker Hub
124
+ uses: docker/login-action@v3
125
+ with:
126
+ username: ${{ secrets.DOCKER_USERNAME }}
127
+ password: ${{ secrets.DOCKER_PASSWORD }}
128
+
129
+ - name: Create manifest list and push
130
+ working-directory: /tmp/digests
131
+ run: |
132
+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
133
+ $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
134
+
135
+ - name: Inspect image
136
+ run: |
137
+ docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
138
+
139
+ - name: Redeploy FastLED web service
140
+ run: |
141
+ curl ${{ secrets.FASTLED_REDEPLOY_URL }}
142
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.1.24
3
+ Version: 1.1.26
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -161,8 +161,12 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
161
161
  Q: How can I get the compiled size of my FastLED sketch smaller?
162
162
  A: A big chunk of space is being used by unnecessary javascript `emscripten` is bundling. This can be tweeked by the wasm_compiler_settings.py file in the FastLED repo.
163
163
 
164
- # Revisions
165
164
 
165
+
166
+ # Revisions
167
+
168
+ * 1.1.26 - Fixed `--interactive` so that it now works correctly.
169
+ * 1.1.25 - Improved detecting which sketch directory the user means by fuzzy matching.
166
170
  * 1.1.24 - Adds progress spinning bar for pulling images, which take a long time.
167
171
  * 1.1.23 - Various fixes for MacOS
168
172
  * 1.1.22 - Selecting sketch now allows strings and narrowing down paths if ambiguity
@@ -138,8 +138,12 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
138
138
  Q: How can I get the compiled size of my FastLED sketch smaller?
139
139
  A: A big chunk of space is being used by unnecessary javascript `emscripten` is bundling. This can be tweeked by the wasm_compiler_settings.py file in the FastLED repo.
140
140
 
141
- # Revisions
142
141
 
142
+
143
+ # Revisions
144
+
145
+ * 1.1.26 - Fixed `--interactive` so that it now works correctly.
146
+ * 1.1.25 - Improved detecting which sketch directory the user means by fuzzy matching.
143
147
  * 1.1.24 - Adds progress spinning bar for pulling images, which take a long time.
144
148
  * 1.1.23 - Various fixes for MacOS
145
149
  * 1.1.22 - Selecting sketch now allows strings and narrowing down paths if ambiguity
@@ -1,131 +1,138 @@
1
- /// @file NoisePlusPalette.ino
2
- /// @brief Demonstrates how to mix noise generation with color palettes on a
3
- /// 2D LED matrix
4
- /// @example NoisePlusPalette.ino
5
-
6
- // printf
7
- #include <stdio.h>
8
- #include <string>
9
-
10
- #include <FastLED.h>
11
- #include "fx/2d/noisepalette.hpp"
12
- #include "json.h"
13
- #include "slice.h"
14
- #include "fx/fx_engine.h"
15
-
16
- #include "fx/2d/animartrix.hpp"
17
- #include "ui.h"
18
-
19
-
20
- #define LED_PIN 3
21
- #define BRIGHTNESS 96
22
- #define COLOR_ORDER GRB
23
-
24
- #define MATRIX_WIDTH 100
25
- #define MATRIX_HEIGHT 100
26
- #define GRID_SERPENTINE false
27
-
28
- #define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
29
-
30
- // This example combines two features of FastLED to produce a remarkable range
31
- // of effects from a relatively small amount of code. This example combines
32
- // FastLED's color palette lookup functions with FastLED's Perlin noise
33
- // generator, and the combination is extremely powerful.
34
- //
35
- // You might want to look at the "ColorPalette" and "Noise" examples separately
36
- // if this example code seems daunting.
37
- //
38
- //
39
- // The basic setup here is that for each frame, we generate a new array of
40
- // 'noise' data, and then map it onto the LED matrix through a color palette.
41
- //
42
- // Periodically, the color palette is changed, and new noise-generation
43
- // parameters are chosen at the same time. In this example, specific
44
- // noise-generation values have been selected to match the given color palettes;
45
- // some are faster, or slower, or larger, or smaller than others, but there's no
46
- // reason these parameters can't be freely mixed-and-matched.
47
- //
48
- // In addition, this example includes some fast automatic 'data smoothing' at
49
- // lower noise speeds to help produce smoother animations in those cases.
50
- //
51
- // The FastLED built-in color palettes (Forest, Clouds, Lava, Ocean, Party) are
52
- // used, as well as some 'hand-defined' ones, and some proceedurally generated
53
- // palettes.
54
-
55
- // Scale determines how far apart the pixels in our noise matrix are. Try
56
- // changing these values around to see how it affects the motion of the display.
57
- // The higher the value of scale, the more "zoomed out" the noise iwll be. A
58
- // value of 1 will be so zoomed in, you'll mostly see solid colors.
59
- #define SCALE 20
60
-
61
- // We're using the x/y dimensions to map to the x/y pixels on the matrix. We'll
62
- // use the z-axis for "time". speed determines how fast time moves forward. Try
63
- // 1 for a very slow moving effect, or 60 for something that ends up looking
64
- // like water.
65
- #define SPEED 30
66
-
67
- CRGB leds[NUM_LEDS];
68
- XYMap xyMap = XYMap::constructRectangularGrid(MATRIX_WIDTH, MATRIX_HEIGHT);
69
- NoisePalette noisePalette = NoisePalette(xyMap);
70
-
71
- Title title("FastLED Wasm Demo");
72
- Description description("This example combines two features of FastLED to produce a remarkable range of effects from a relatively small amount of code. This example combines FastLED's color palette lookup functions with FastLED's Perlin noise generator, and the combination is extremely powerful.");
73
-
74
- Slider brightness("Brightness", 255, 0, 255);
75
- Checkbox isOff("Off", false);
76
- Slider speed("Noise - Speed", 15, 1, 50);
77
- Checkbox changePallete("Noise - Auto Palette", true);
78
- Slider changePalletTime("Noise - Time until next random Palette", 5, 1, 100);
79
- Slider scale( "Noise - Scale", 20, 1, 100);
80
- Button changePalette("Noise - Next Palette");
81
- Button changeFx("Switch between Noise & Animartrix");
82
- NumberField fxIndex("Animartrix - iex", 0, 0, NUM_ANIMATIONS);
83
-
84
- Animartrix animartrix(xyMap, POLAR_WAVES);
85
- FxEngine fxEngine(NUM_LEDS);
86
-
87
-
88
-
89
- void setup() {
90
- FastLED.addLeds<WS2811, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS)
91
- .setCorrection(TypicalLEDStrip)
92
- .setScreenMap(xyMap);
93
- FastLED.setBrightness(brightness);
94
- //noisePalette.setSpeed(speed);
95
- noisePalette.setScale(scale);
96
- fxEngine.addFx(animartrix);
97
- fxEngine.addFx(noisePalette);
98
- }
99
-
100
- void loop() {
101
- FastLED.setBrightness(!isOff ? brightness.as<uint8_t>() : 0);
102
- noisePalette.setSpeed(speed);
103
- noisePalette.setScale(scale);
104
-
105
- if (changeFx) {
106
- fxEngine.nextFx();
107
- }
108
- static int frame = 0;
109
- EVERY_N_MILLISECONDS_DYNAMIC(changePalletTime.as<int>() * 1000) {
110
- if (changePallete) {
111
- noisePalette.changeToRandomPalette();
112
- }
113
- }
114
-
115
- if (changePalette) {
116
- noisePalette.changeToRandomPalette();
117
-
118
- }
119
- static int lastFxIndex = -1;
120
- if (fxIndex.value() != lastFxIndex) {
121
- lastFxIndex = fxIndex;
122
- animartrix.fxSet(fxIndex);
123
- }
124
-
125
-
126
- fxEngine.draw(millis(), leds);
127
- FastLED.show();
128
- frame++;
129
- }
130
-
131
-
1
+ /// @file wasm.ino
2
+ /// @brief Demonstrates an advanced ino file with multiple effects and UI elements
3
+ /// @author Zach Vorhies
4
+ ///
5
+ /// This sketch is fully compatible with the FastLED web compiler. To use it do the following:
6
+ /// 1. Install Fastled: `pip install fastled`
7
+ /// 2. cd into this examples page.
8
+ /// 3. Run the FastLED web compiler at root: `fastled`
9
+ /// 4. When the compiler is done a web page will open.
10
+
11
+
12
+ #include <stdio.h>
13
+ #include <string>
14
+
15
+ #include <FastLED.h>
16
+ #include "fx/2d/noisepalette.hpp"
17
+ #include "fl/json.h"
18
+ #include "fl/slice.h"
19
+ #include "fx/fx_engine.h"
20
+
21
+ #include "fx/2d/animartrix.hpp"
22
+ #include "fl/ui.h"
23
+
24
+ using namespace fl;
25
+
26
+
27
+ #define LED_PIN 3
28
+ #define BRIGHTNESS 96
29
+ #define COLOR_ORDER GRB
30
+
31
+ #define MATRIX_WIDTH 100
32
+ #define MATRIX_HEIGHT 100
33
+ #define GRID_SERPENTINE false
34
+
35
+ #define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
36
+
37
+ // This example combines two features of FastLED to produce a remarkable range
38
+ // of effects from a relatively small amount of code. This example combines
39
+ // FastLED's color palette lookup functions with FastLED's Perlin noise
40
+ // generator, and the combination is extremely powerful.
41
+ //
42
+ // You might want to look at the "ColorPalette" and "Noise" examples separately
43
+ // if this example code seems daunting.
44
+ //
45
+ //
46
+ // The basic setup here is that for each frame, we generate a new array of
47
+ // 'noise' data, and then map it onto the LED matrix through a color palette.
48
+ //
49
+ // Periodically, the color palette is changed, and new noise-generation
50
+ // parameters are chosen at the same time. In this example, specific
51
+ // noise-generation values have been selected to match the given color palettes;
52
+ // some are faster, or slower, or larger, or smaller than others, but there's no
53
+ // reason these parameters can't be freely mixed-and-matched.
54
+ //
55
+ // In addition, this example includes some fast automatic 'data smoothing' at
56
+ // lower noise speeds to help produce smoother animations in those cases.
57
+ //
58
+ // The FastLED built-in color palettes (Forest, Clouds, Lava, Ocean, Party) are
59
+ // used, as well as some 'hand-defined' ones, and some proceedurally generated
60
+ // palettes.
61
+
62
+ // Scale determines how far apart the pixels in our noise matrix are. Try
63
+ // changing these values around to see how it affects the motion of the display.
64
+ // The higher the value of scale, the more "zoomed out" the noise iwll be. A
65
+ // value of 1 will be so zoomed in, you'll mostly see solid colors.
66
+ #define SCALE 20
67
+
68
+ // We're using the x/y dimensions to map to the x/y pixels on the matrix. We'll
69
+ // use the z-axis for "time". speed determines how fast time moves forward. Try
70
+ // 1 for a very slow moving effect, or 60 for something that ends up looking
71
+ // like water.
72
+ #define SPEED 30
73
+
74
+ CRGB leds[NUM_LEDS];
75
+ XYMap xyMap = XYMap::constructRectangularGrid(MATRIX_WIDTH, MATRIX_HEIGHT);
76
+ NoisePalette noisePalette = NoisePalette(xyMap);
77
+
78
+ Title title("FastLED Wasm Demo");
79
+ Description description("This example combines two features of FastLED to produce a remarkable range of effects from a relatively small amount of code. This example combines FastLED's color palette lookup functions with FastLED's Perlin noise generator, and the combination is extremely powerful");
80
+
81
+ Slider brightness("Brightness", 255, 0, 255);
82
+ Checkbox isOff("Off", false);
83
+ Slider speed("Noise - Speed", 15, 1, 50);
84
+ Checkbox changePallete("Noise - Auto Palette", true);
85
+ Slider changePalletTime("Noise - Time until next random Palette", 5, 1, 100);
86
+ Slider scale( "Noise - Scale", 20, 1, 100);
87
+ Button changePalette("Noise - Next Palette");
88
+ Button changeFx("Switch between Noise & Animartrix");
89
+ NumberField fxIndex("Animartrix - index", 0, 0, NUM_ANIMATIONS);
90
+ Slider timeSpeed("Time Speed", 1, -10, 10, .1);
91
+
92
+ Animartrix animartrix(xyMap, POLAR_WAVES);
93
+ FxEngine fxEngine(NUM_LEDS);
94
+
95
+ void setup() {
96
+ FastLED.addLeds<WS2811, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS)
97
+ .setCorrection(TypicalLEDStrip)
98
+ .setScreenMap(xyMap);
99
+ FastLED.setBrightness(brightness);
100
+ //noisePalette.setSpeed(speed);
101
+ noisePalette.setScale(scale);
102
+ fxEngine.addFx(animartrix);
103
+ fxEngine.addFx(noisePalette);
104
+ }
105
+
106
+ void loop() {
107
+ FastLED.setBrightness(!isOff ? brightness.as<uint8_t>() : 0);
108
+ noisePalette.setSpeed(speed);
109
+ noisePalette.setScale(scale);
110
+ fxEngine.setSpeed(timeSpeed);
111
+
112
+ if (changeFx) {
113
+ fxEngine.nextFx();
114
+ }
115
+ static int frame = 0;
116
+ EVERY_N_MILLISECONDS_DYNAMIC(changePalletTime.as<int>() * 1000) {
117
+ if (changePallete) {
118
+ noisePalette.changeToRandomPalette();
119
+ }
120
+ }
121
+
122
+ if (changePalette) {
123
+ noisePalette.changeToRandomPalette();
124
+
125
+ }
126
+ static int lastFxIndex = -1;
127
+ if (fxIndex.value() != lastFxIndex) {
128
+ lastFxIndex = fxIndex;
129
+ animartrix.fxSet(fxIndex);
130
+ }
131
+
132
+
133
+ fxEngine.draw(millis(), leds);
134
+ FastLED.show();
135
+ frame++;
136
+ }
137
+
138
+
@@ -1,3 +1,3 @@
1
1
  """FastLED Wasm Compiler package."""
2
2
 
3
- __version__ = "1.1.24"
3
+ __version__ = "1.1.26"
@@ -157,7 +157,7 @@ def run_server(args: argparse.Namespace) -> int:
157
157
  compile_server = CompileServer(interactive=interactive, auto_updates=auto_update)
158
158
  if not interactive:
159
159
  print(f"Server started at {compile_server.url()}")
160
- compile_server.wait_for_startup()
160
+ compile_server.wait_for_startup()
161
161
  try:
162
162
  while True:
163
163
  if not compile_server.proceess_running():
@@ -192,7 +192,8 @@ def main() -> int:
192
192
  if __name__ == "__main__":
193
193
  try:
194
194
  os.chdir("../fastled")
195
- sys.argv.append("--upgrade")
195
+ sys.argv.append("--interactive")
196
+ sys.argv.append("examples/NoiseRing")
196
197
  sys.exit(main())
197
198
  except KeyboardInterrupt:
198
199
  print("\nExiting from main...")
@@ -269,13 +269,19 @@ def run_client_server(args: argparse.Namespace) -> int:
269
269
  timeout=1.0
270
270
  )
271
271
  file_changes = source_code_watcher.get_all_changes()
272
+ sketch_files_changed = sketch_filewatcher.get_all_changes()
272
273
 
273
- if space_bar_pressed or file_changes:
274
+ if file_changes:
275
+ print(
276
+ f"Changes detected in {file_changes}\nHit the space bar to trigger compile."
277
+ )
278
+
279
+ if space_bar_pressed or sketch_files_changed:
274
280
  if space_bar_pressed:
275
281
  print("Space bar pressed, triggering recompile...")
276
- elif file_changes:
282
+ elif sketch_files_changed:
277
283
  print(
278
- f"Changes detected in {','.join(file_changes)}, triggering recompile..."
284
+ f"Changes detected in {','.join(sketch_files_changed)}, triggering recompile..."
279
285
  )
280
286
  last_compiled_result = compile_function(
281
287
  last_hash_value=None