A browser-based simulator for the Berry Animation Framework, enabling LED strip animation development and testing directly in your web browser without hardware.
No installation required - runs entirely in your browser.
This project is part of Tasmota, an open-source firmware for ESP32/ESP8266 devices. Tasmota provides extensive home automation capabilities, including addressable LED strip control through the Berry scripting language.
The Berry Animation Framework introduces a simplified Domain-Specific Language (DSL) for creating LED animations. This simulator compiles the Berry interpreter to WebAssembly, allowing you to develop and test animations in your browser before deploying to hardware.
- Browser-Based - No hardware required, runs entirely in WebAssembly
- Real-Time Preview - See your animations on a virtual LED strip
- DSL Support - Write animations using the simplified animation DSL
- Berry Support - Full Berry language support for advanced animations
- Example Library - Browse and run example animations instantly
- APNG Export - Export animations as animated PNG files for sharing
- Tasmota UI - Familiar interface matching Tasmota's web UI style
| Rainbow Wave | Fire Effect |
|---|---|
![]() |
Cycling color pattern |
![]() |
Cylon red eye |
- Open the simulator
- Select an example from the Animation Library panel
- Click "Compile & Run" to see the animation
- Modify the code and experiment!
# Clone the repository
git clone https://github.com/s-hadinger/Tasmota-Berry-emulator.git
cd Tasmota-Berry-emulator
# Open in browser (no server required)
open dist/index.htmlThe simulator includes a library of example animations - just select one from the Animation Library panel and click "Compile & Run". Here's a sample of what the DSL looks like:
# @desc Smooth color transitions using rich_palette_color with sine interpolation
# define a palette of rainbow colors including white with constant brightness
palette rainbow_with_white = [
0xFC0000 # Red
0xFF8000 # Orange
0xFFFF00 # Yellow
0x00FF00 # Green
0x00FFFF # Cyan
0x0080FF # Blue
0x8000FF # Violet
0xCCCCCC # White
0xFC0000 # Red - need to add the first color at last position to ensure roll-over
]
# define a color attribute that cycles over time, cycle is 10 seconds
color rainbow_rich_color = rich_palette_color(colors=rainbow_with_white, period=10s, transition_type=SINE)
animation back = solid(color=rainbow_rich_color)
run back- Animation Framework README - Overview and quick start
- DSL Reference - Complete DSL syntax
- Animation Classes - Available animations
- Berry JS Module - JavaScript bridge API for Berry
- LED Strip API - LED rendering API
- Tasmota Documentation - Official Tasmota docs
- Berry Language - Berry language reference
- Tasmota Berry Guide - Berry in Tasmota
- Emscripten SDK for WebAssembly compilation
- Make and Clang (recommended) or GCC
# Full build (native + WebAssembly)
./build.sh
# Or build separately:
# Native Berry interpreter
make -C berry-lang clean
make -C berry-lang
# WebAssembly build
source emsdk/emsdk_env.sh
make -C berry-lang clean BUILD_MODE=emsdk
make -C berry-lang BUILD_MODE=emsdk# Run all tests
./run_all_tests.sh
# Compile all DSL examples
./compile_all_dsl_examples.shβββ dist/ # Browser simulator files
β βββ index.html # Main simulator page
β βββ berry.js # Berry WASM module
β βββ *.js # JavaScript modules
βββ lib/libesp32/berry_animation/
β βββ src/ # Animation framework source
β βββ anim_examples/ # Example animations
β βββ anim_tutorials/ # Tutorial animations
β βββ docs/ # Framework documentation
βββ berry-lang/ # Berry interpreter source
βββ tasmota_env/ # Tasmota emulator for local dev
βββ docs/ # Simulator documentation
βββ emsdk/ # Emscripten SDK
Contributions are welcome! This project is part of the Tasmota ecosystem.
- Fork the repository
- Create a feature branch
- Make your changes
- Test with the simulator
- Submit a pull request
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Part of the Tasmota project.
- Tasmota GitHub - Main Tasmota repository
- Tasmota Documentation - Official documentation
- Berry Language - Berry scripting language
- Berry Short Manual (PDF) - 8-page Berry reference
Happy Animating! π¨β¨


