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.
- {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/build_multi_docker_image.yml +142 -107
- {fastled-1.1.24 → fastled-1.1.26}/PKG-INFO +6 -2
- {fastled-1.1.24 → fastled-1.1.26}/README.md +5 -1
- {fastled-1.1.24 → fastled-1.1.26}/examples/wasm/wasm.ino +138 -131
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/__init__.py +1 -1
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/app.py +3 -2
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/client_server.py +9 -3
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/compile_server.py +31 -16
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/docker_manager.py +53 -3
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/select_sketch_directory.py +1 -1
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/string_diff.py +15 -9
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/PKG-INFO +6 -2
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_ino/bad/bad.ino +1 -1
- {fastled-1.1.24/tests/test_ino/wasm → fastled-1.1.26/tests/test_ino/embedded}/wasm.ino +1 -1
- {fastled-1.1.24/tests/test_ino/embedded → fastled-1.1.26/tests/test_ino/wasm}/wasm.ino +134 -134
- {fastled-1.1.24 → fastled-1.1.26}/.aiderignore +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/lint.yml +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/test_macos.yml +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/test_ubuntu.yml +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.github/workflows/test_win.yml +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.gitignore +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.pylintrc +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.vscode/launch.json +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.vscode/settings.json +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/.vscode/tasks.json +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/LICENSE +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/MANIFEST.in +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/clean +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/docs/fastled.js +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/docs/fastled.wasm +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/docs/index.css +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/docs/index.html +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/docs/index.js +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Blink/Blink.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/Chromancer.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/detail.h +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/gary_woos_wled_port/gary_woos_wled_ledmap.h +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/gary_woos_wled_port/presets.json +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/gary_woos_wled_port/presets.min.json +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/gen.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/mapping.h +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/net.h +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/output.json +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/ripple.h +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Chromancer/screenmap.json.h +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/ColorPalette/ColorPalette.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/ColorTemperature/ColorTemperature.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Cylon/Cylon.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/DemoReel100/DemoReel100.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Esp32Rmt51/Esp32Rmt51.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/EspI2SDemo/EspI2SDemo.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Fire2012/Fire2012.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Fire2012WithPalette/Fire2012WithPalette.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/FirstLight/FirstLight.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/FxEngine/FxEngine.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Noise/Noise.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/NoisePlayground/NoisePlayground.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/NoisePlusPalette/NoisePlusPalette.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/OctoWS2811/OctoWS2811.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Pacifica/Pacifica.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Pride2015/Pride2015.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/SdCard/SdCard.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/SdCard/screenmap.json.h +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/TwinkleFox/TwinkleFox.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Video/Gfx2Video/Gfx2Video.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/WasmScreenCoords/WasmScreenCoords.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/Water/Water.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/examples/XYMatrix/XYMatrix.ino +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/install +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/lint +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/pyproject.toml +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/requirements.testing.txt +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/setup.cfg +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/setup.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/assets/example.txt +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/build_mode.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/cli.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/env.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/filewatcher.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/keyboard.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/open_browser.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/paths.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/sketch.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/spinner.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/types.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/util.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled/web_compile.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/SOURCES.txt +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/dependency_links.txt +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/entry_points.txt +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/requires.txt +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/src/fastled.egg-info/top_level.txt +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/test +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_bad_ino.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_cli.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_compile_server.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_embedded_data.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_filechanger.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_ino/embedded/data/bigdata.dat +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_server_and_client_seperatly.py +0 -0
- {fastled-1.1.24 → fastled-1.1.26}/tests/test_webcompile.py +0 -0
- {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
|
-
|
15
|
-
runs-on: ubuntu-latest
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
- name:
|
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
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
-
|
105
|
-
|
106
|
-
|
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.
|
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
|
2
|
-
/// @brief Demonstrates
|
3
|
-
///
|
4
|
-
///
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
#include
|
13
|
-
#include
|
14
|
-
|
15
|
-
|
16
|
-
#include "fx/2d/
|
17
|
-
#include "
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
#
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
#define
|
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
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
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
|
+
|
@@ -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
|
-
|
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("--
|
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
|
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
|
282
|
+
elif sketch_files_changed:
|
277
283
|
print(
|
278
|
-
f"Changes detected in {','.join(
|
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
|