Skip to main content

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.

Linting Build and Push Multi Docker Image MacOS_Tests Ubuntu_Tests Win_Tests

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

cd <SKETCH-DIRECTORY>
fastled-wasm

Or if you don't have docker then use our web compiler

cd <SKETCH-DIRECTORY>
fastled-wasm --web

After compilation a web browser windows will pop up.

Hot reload by default

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.11 - --web compile will automatically be enabled if the local build using docker fails.
  • 1.0.10 - Watching files is now available for --web
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastled_wasm-1.0.11.tar.gz (153.0 kB view details)

Uploaded Source

Built Distribution

fastled_wasm-1.0.11-py2.py3-none-any.whl (15.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file fastled_wasm-1.0.11.tar.gz.

File metadata

  • Download URL: fastled_wasm-1.0.11.tar.gz
  • Upload date:
  • Size: 153.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for fastled_wasm-1.0.11.tar.gz
Algorithm Hash digest
SHA256 ba554455dcb4b62e643bd88fc17244b1d819a962d0daa1320aef10e5b58895bd
MD5 be881992400607cd9d03007c2c7cfb02
BLAKE2b-256 bf2b850b6a0a2c791e9e768a08605ca1175653646f26efc5047cb47fccc3e768

See more details on using hashes here.

File details

Details for the file fastled_wasm-1.0.11-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for fastled_wasm-1.0.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f2fc67bda7ba7fe79297e7d7def87ccd5ed097d3d972274e622659c0550d7b03
MD5 b4b8f728d3430ce9868516d9b1a5caf3
BLAKE2b-256 745d2643824c7fa90fb1abca34191728eb44aa38cb83a69179c9bf4eb679851a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page