FastLED Wasm Compiler
Project description
FastLED wasm compiler
Compiles an Arduino/Platformio sketch into a wasm binary that can be run directly in the web browser.
About
This python app will compile your FastLED style sketches into html/js/wasm output that runs directly in the browser.
Compile times are extremely fast - I've seen as low as 5 seconds but 8-15 seconds is typical.
This works on Windows/Linux/Mac(arm/x64).
Docker is required.
https://github.com/user-attachments/assets/64ae0e6c-5f8b-4830-ab87-dcc25bc61218
Demo
https://zackees.github.io/fastled-wasm/
Install
pip install fastled-wasm
Note that you may need to install x86 docker emulation on Mac-m1 and later, as this is an x86 only image at the prsent.
Use
Change to the directory where the sketch lives and run
fastled-wasm
The compiler should download, compile the target and then launch a web-browser.
Hot reload by default (not enabled for --web compiler)
Once launched, the compiler will remain open, listening to changes and recompiling as necessary and hot-reloading the sketch into the current browser.
This style of development should be familiar to those doing web development.
Data
If you want to embed data, then do so in the data/
directory at the project root. The files will appear in the data/
director of any spawned FileSystem or SDCard.
About the compilation.
Pre-processing is done to your source files. A fake Arduino.h will be inserted into your source files that will provide shims for most of the common api points.
Revisions
- 1.0.9 - Enabled web compile. Access it with
--web
or--web-host
- 1.0.8 - Allow more than one fastled-wasm browser instances to co-exist by searching for unused ports after 8081.
- 1.0.7 - Docker multi image build implemented, tool now points to new docker image compile.
- 1.0.6 - Removed
--no-open
and--watch
,--watch
is now assumed unless--just-compile
is used. - 1.0.5 - Implemented
--update
to update the compiler image from the docker registry. - 1.0.4 - Implemented
--watch
which will watch for changes and then re-launch the compilation step. - 1.0.3 - Integrated
live-server
to launch when available. - 1.0.2 - Small bug with new installs.
- 1.0.1 - Re-use is no longer the default, due to problems.
- 1.0.0 - Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fastled_wasm-1.0.9.tar.gz
.
File metadata
- Download URL: fastled_wasm-1.0.9.tar.gz
- Upload date:
- Size: 152.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 806d98374e0bb7b8695e40d3a296fb8401328354a3b2a4773eb1b1597c421d5b |
|
MD5 | f7b13abc33c28f180c1a033deec634b0 |
|
BLAKE2b-256 | 07cb2a36469a06ae9d29569dbbaade29b4272c59434d725921cc8c39ab5d9579 |
File details
Details for the file fastled_wasm-1.0.9-py2.py3-none-any.whl
.
File metadata
- Download URL: fastled_wasm-1.0.9-py2.py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ab07cb45c7838f059d0b32b5a4088e18033b85e2ebe0c3edc3c75c582f99e4e |
|
MD5 | c2f5c31ac4c7e323d5c46ec0fed3b09e |
|
BLAKE2b-256 | 81c3f4fc9da5d5bd0699983758a80e250bd162ccc7b917c936d5273c2594ced9 |