Getting Started#
This guide walks you through setting up your first micro-LF project.
Prerequisites#
The code generator requires:
- Git - git-scm.com
- Java 17 - openjdk.org (for the Lingua Franca compiler)
Platform-specific tools:
| Platform | Additional Requirements |
|---|---|
| Native | cmake |
| Zephyr | Python 3, west, Zephyr SDK |
| RIOT | make 4.0+, ARM cross-compiler |
| Pico | CMake, ARM cross-compiler, picotool |
| FreeRTOS | CMake, ARM cross-compiler |
| ESP-IDF | Python 3, CMake, ESP-IDF toolchain |
Quick Start#
1. Clone micro-LF#
git clone https://github.com/lf-lang/reactor-uc.git --recurse-submodules
export REACTOR_UC_PATH=$(pwd)/reactor-uc
2. Clone a template repository#
Choose a template for your target platform (except "Native", which does not need a template repo):
-
Zephyr · West
-
RIOT · Make
-
Raspberry Pi Pico · CMake
-
FreeRTOS · CMake
-
ESP-IDF · CMake
3. Build and run#
Your First Reactor#
Each template includes example applications. Here's a simple Blinky reactor:
target uC
main reactor {
timer t(0, 500 ms)
state led_on: bool = false
reaction(startup) {=
// Initialize LED GPIO
=}
reaction(t) {=
self->led_on = !self->led_on;
// Toggle LED based on self->led_on
=}
}
This reactor:
- Declares a timer
tthat fires immediately (0) and repeats every500 ms - Maintains state
led_onto track the LED status - Has a reaction to
startupfor initialization - Has a reaction to timer
tthat toggles the LED
To build a different application, set the LF_MAIN variable:
Next Steps#
-
Platforms
Detailed setup instructions for each supported platform.
-
Philosophy
Understand the reactor model, logical time, and deterministic concurrency.
-
Documentation
API reference, annotations, and compile flags.
