Interfaces pour petits écrans SPI (ST7789, ST7735S) sur Arduino et ESP32. Dessinez dans Studio, exportez du C++, flashez.
UIs for small SPI displays (ST7789, ST7735S) on Arduino and ESP32. Design in Studio, export C++, flash.
En bref
In short
Installer la libInstall the libraryCopiez Lucarne dans Arduino/libraries.Copy Lucarne to Arduino/libraries.
Ouvrir StudioOpen Studioeditor/index.html — bientôt aussi en ligne.editor/index.html — hosted version coming.
Exporter & flasherExport & flashExport .h → copier à côté du .ino → compiler.Export .h → copy next to .ino → build.
Installation
Installation
Librairie firmware + éditeur web (aucun npm requis).
Firmware library + web editor (no npm required).
Arduino IDE
Dossier du repo → Documents/Arduino/libraries/Lucarne
Repo folder → Documents/Arduino/libraries/Lucarne
PlatformIO
lib/Lucarne/ouorlib_deps
Lucarne Studio
Servez editor/ (Live Server, python -m http.server…) et ouvrez index.html. Le projet se sauvegarde dans le navigateur ; Save / Load pour un fichier .lucarne.json.
Serve editor/ (Live Server, python -m http.server…) and open index.html. Project auto-saves in the browser; Save / Load for a .lucarne.json file.
Vue d'ensemble : blueprint, réglages écran et inspecteur projet.Overview: blueprint, display settings and project inspector.
BlueprintAjoutez des écrans (+ Screen). Reliez les entrées de menu d'un écran à un autre en tirant un lien. Double-clic = ouvrir le designer.Add screens (+ Screen). Drag menu item links between screens. Double-click = open designer.
SimulateFlèches ou pad = menu. Clic sur boutons/switches. Teste les transitions.Arrows or pad = menu. Click buttons/switches. Tests transitions.
Barre du haut
Top bar
ÉlémentItem
RôleRole
Device
Modèle d'écran et résolution (240×280, 128×128…)Panel preset and resolution (240×280, 128×128…)
Rotation
Orientation logique 0° à 270°Logical orientation 0° to 270°
Live
Connexion USB pour aperçu sur carte réelleUSB connection for on-device preview
Export .h
Génère les headers C++ du projetGenerates project C++ headers
Save / Load
Fichier projet .lucarne.jsonProject file .lucarne.json
Blueprint : écrans, liens de menu et écran START.Blueprint: screens, menu links and START screen.Designer : palette widgets, canvas et calques.Designer: widget palette, canvas and layers.
Export Arduino
Arduino export
Studio génère le UI ; vous gardez le câblage SPI dans le .ino.
Studio generates the UI; you keep SPI wiring in the .ino.
Export .h dans Studio → copier ou télécharger. in Studio → copy or download.
Projet.h (+ éventuellement Projet_fonts.h, Projet_images.h, Projet_icons.h) à côté du .ino.Projet.h (+ optional Projet_fonts.h, Projet_images.h, Projet_icons.h) next to .ino.
Câblez le display dans setup() — l'export ne connaît pas vos broches.Wire the display in setup() — export does not know your pins.
home settings wifi bluetooth battery thermo drop fan bell chart power sun lock check cross arrow_up arrow_down arrow_left arrow_right play pause plus minus
Assets → icônes : packs Streamline, Tabler, recherche et export embarqué.Assets → icons: Streamline, Tabler packs, search and embedded export.
Transitions
SlideLeft, Fade, Push… — nécessitent BufferMode::Full. back() inverse les slides. Splash : écran START + durée dans l'inspecteur nœud.
SlideLeft, Fade, Push… — need BufferMode::Full. back() reverses slides. Splash: START screen + duration in node inspector.
Voir le design sur la vraie carte en USB — sans reflasher à chaque changement de widget.
See the design on real hardware over USB — no reflash per widget change.
FlasherFlashexamples/LucarnePreview/LucarnePreview.ino — ESP32-S3 : USB CDC On Boot activé. Pas de Serial.print. — ESP32-S3: USB CDC On Boot on. No Serial.print.
ConnecterConnect
Chrome/Edge : bouton Live dans la barre du haut → choisir le port. Fermez le moniteur série Arduino.Chrome/Edge: Live button in the top bar → pick the port. Close the Arduino serial monitor.
Designer ou SimulateDesigner or Simulate = ce qui s'affiche sur l'écran. = what appears on the panel.
Polices & exemples
Fonts & examples
Polices
Fonts
Inclus : LucarneFontBody et LucarneFontTitle (Fira Sans, anti-aliasé). Studio → Fonts : Google ou TTF → assigner dans Theme → export Projet_fonts.h.
Included: LucarneFontBody and LucarneFontTitle (Fira Sans, anti-aliased). Studio → Fonts: Google or TTF → assign in Theme → exports Projet_fonts.h.
Onglet Theme : palette, radius/padding et polices body/title.Theme tab: palette, radius/padding and body/title fonts.
Exemples Arduino
Arduino examples
Sketch
UsagePurpose
HelloLucarne
Gfx bas niveau, sans UI runtimeLow-level Gfx, no UI runtime
LucarneUI
Dashboard Metric/Bar et liaison de donnéesDashboard Metric/Bar and data binding
Non. Lucarne cible les petits écrans SPI avec un flux design → export C++ statique, léger en RAM, sans moteur de rendu lourd sur la carte. LVGL reste plus adapté aux UIs complexes multi-couches avec beaucoup de widgets dynamiques.
No. Lucarne targets small SPI panels with a design → static C++ export flow, light on RAM, without a heavy on-device renderer. LVGL remains better for complex multi-layer UIs with many dynamic widgets.
Faut-il Internet pour utiliser Studio ?Do I need Internet for Studio?
Non pour l'édition de base. Internet sert surtout à charger des polices Google Fonts et les icônes Tabler si elles ne sont pas embarquées. Les packs Streamline/Glyphs inclus fonctionnent hors ligne.
No for basic editing. Internet is mainly for Google Fonts and Tabler icons when not embedded. Bundled Streamline/Glyphs packs work offline.
Où est sauvegardé mon projet ?Where is my project saved?
Dans le stockage local du navigateur (localStorage). Utilisez Save pour un fichier .lucarne.json portable. Effacer les données du site supprime le projet non exporté.
In browser localStorage. Use Save for a portable .lucarne.json file. Clearing site data deletes an unexported project.
Studio & export
Dois-je re-exporter après chaque modification ?Must I re-export after every change?
Oui pour le firmware final. Live Preview affiche le design sans reflasher Projet.h. Dès que vous voulez le UI sur la carte dans votre app, régénérez les headers et recompilez.
Yes for final firmware. Live Preview shows the design without reflashing Projet.h. Once you want the UI in your app on device, regenerate headers and rebuild.
Quels fichiers l'export produit-il ?What files does export produce?
Projet.h toujours. En plus si nécessaire : Projet_fonts.h, Projet_images.h, Projet_icons.h, et binaires assets/*.rgb565 pour images SD.
Projet.h always. Additionally when needed: Projet_fonts.h, Projet_images.h, Projet_icons.h, and assets/*.rgb565 binaries for SD images.
Pourquoi l'export ne configure pas mes broches SPI ?Why doesn't export set my SPI pins?
Chaque carte a un câblage différent. Vous gardez DisplayPins et display.begin() dans votre .ino. L'export ne connaît que le UI (écrans, widgets, thème, entrées).
Every board wires differently. You keep DisplayPins and display.begin() in your .ino. Export only knows UI (screens, widgets, theme, input).
Comment fonctionnent les callbacks menu/bouton ?How do menu/button callbacks work?
Dans Studio, choisissez l'action Callback et un ID (ex. open_settings). L'export crée projet::ACTION_OPEN_SETTINGS. Dans loop(), lisez ui.pollMenuAction() dans un switch — une seule action consommée par appel.
In Studio, set action Callback and an ID (e.g. open_settings). Export creates projet::ACTION_OPEN_SETTINGS. In loop(), read ui.pollMenuAction() in a switch — one action consumed per call.
Affichage & matériel
Display & hardware
Écran noir, rétroéclairage alluméBlack screen, backlight on
Testez options.spiMode = 3 (fréquent sur ST7789). Vérifiez MOSI/SCLK/CS/DC/RST. Lancez LucarneDiag pour valider le panneau.
Try options.spiMode = 3 (common on ST7789). Check MOSI/SCLK/CS/DC/RST. Run LucarneDiag to validate the panel.
Couleurs inversées ou rouge/bleu permutésInverted or red/blue swapped colors
Basculez options.invert et/ou options.colorOrder (RGB vs BGR). Mêmes réglages que dans vos autres croquis qui fonctionnent.
Toggle options.invert and/or options.colorOrder (RGB vs BGR). Match settings from sketches that already work.
Bande de bruit en bas (240×280)Garbage band at bottom (240×280)
Le ST7789 240×280 utilise un offset vertical. Lucarne l'applique par défaut ; sur module exotique, ajustez rowStart / colStart dans DisplayOptions.
ST7789 240×280 uses a vertical offset. Lucarne applies it by default; on exotic modules, tune rowStart / colStart in DisplayOptions.
Les transitions ne s'animent pasTransitions don't animate
Il faut BufferMode::Full et assez de RAM pour deux snapshots temporaires. En BufferMode::None, les changements d'écran sont instantanés.
You need BufferMode::Full and enough RAM for two temporary snapshots. With BufferMode::None, screen changes are instant.
Données, widgets, icônes
Data, widgets, icons
Ma Metric affiche toujours la même valeurMy Metric always shows the same value
Vérifiez que la clé dans l'onglet Data correspond au widget, et que vous appelez ui.setFloat("ma_cle", valeur) (ou int/bool/string) puis ui.update() dans loop().
Check the Data tab key matches the widget, and call ui.setFloat("my_key", value) (or int/bool/string) then ui.update() in loop().
Icône pack absente à l'exportPack icon missing in export
Seules les icônes réellement utilisées dans le projet sont exportées. Ouvrez le projet avec les packs chargés (serveur local sur editor/) avant d'exporter.
Only icons actually used in the project are exported. Open the project with packs loaded (local server on editor/) before exporting.
Le Slider ne réagit pas au toucherSlider doesn't respond to touch
Normal : le Slider est affichage seul. Mettez à jour la clé depuis votre code ou un autre contrôle. Le drag tactile n'est pas implémenté côté firmware.
Expected: Slider is display-only. Update the key from your code or another control. Touch drag is not implemented in firmware.
Live Preview
Le bouton Live ne fait rienLive button does nothing
Utilisez Chrome ou Edge (Web Serial). Fermez le moniteur série de l'IDE Arduino. Flashez LucarnePreview.ino avec USB CDC activé sur ESP32-S3.
Use Chrome or Edge (Web Serial). Close the Arduino IDE serial monitor. Flash LucarnePreview.ino with USB CDC enabled on ESP32-S3.
Live vs firmware exportéLive vs exported firmware
Live envoie des images calculées par Studio. Votre app avec Projet.h exécute le vrai runtime UI sur la carte. Utilisez Live pour itérer visuellement, puis exportez pour le produit final.
Live sends frames rendered by Studio. Your app with Projet.h runs the real UI runtime on device. Use Live to iterate visually, then export for production.
Remerciements & licences
Acknowledgements & licenses
Fira SansPolice par défaut (corps et titre). SIL Open Font License 1.1 — Mozilla Foundation.Default body and title font. SIL Open Font License 1.1 — Mozilla Foundation.
Tabler IconsPack d'icônes optionnel dans Studio. MIT License — Tabler.Optional icon pack in Studio. MIT License — Tabler.
Streamline & Glyphs packsIcônes couleur 32×32 embarquées dans l'éditeur. Voir les licences des packs respectifs dans le dépôt distributeur.32×32 color icons embedded in the editor. See respective pack licenses in the distribution repo.
Arduino & ESP32Toolchains et cores utilisés pour compiler les exemples — non inclus dans Lucarne.Toolchains and cores used to build examples — not bundled with Lucarne.
Lucarne est un projet open source. Contributions et retours bienvenus sur le dépôt GitHub.
Lucarne is an open source project. Contributions and feedback welcome on the GitHub repository.