OmegaStar – 900 LED ESP32-S3 Lighting Star
A 900-LED interactive star with dynamic lighting, audio-reactive effects and remote control.
Devices & Components
1
ESP32-S3-Touch-LCD-7
15
WS2812 60LED/M en ml
4
ESP32-S3 Devkit
Hardware & Tools
1
3D Printing
Software & Tools
1
VS Code and PlatformIO
Project description
Code
main
Main of Master, 1 / 100 codea
1#include <Arduino.h> 2#include <WiFi.h> 3#include "globals.h" 4#include "fft_uart.h" 5#include "system_data.h" 6#include "oled_display.h" 7#include "rf_remote.h" 8#include "espnow_sync.h" 9#include "palette_engine.h" 10#include "system_state.h" 11#include "auto_manager.h" 12#include "speed_table.h" 13#include "audio_lab.h" 14#include "Star_audio.h" 15#include "remote_packet.h" 16#include "remote_manager.h" 17#include "terminal_remote.h" 18 19//================================================ 20// Setup 21//================================================ 22 23void setup() 24 25{ 26 Serial.begin(115200); 27 28 initFFTUART(); 29 30 initOLED(); 31 32 initRF(); 33 34 initEspNow(); 35 36 initAudioLab(); 37 38//======================================== 39// Initialiser systemState 40//========================================= 41 42systemState.selection = SELECT_EFFECTS; 43systemState.mode = MODE_MANUAL; 44systemState.paletteMode = PALETTE_MANUAL; 45 46systemState.scene = 0; 47systemState.category = currentEffectGroup; 48systemState.effect = currentEffect; 49systemState.palette = currentPalette; 50 51systemState.brightness = brightness; 52systemState.speed = effectSpeed; 53 54//------------------------------------ajout 55 56systemState.categorySpeedLevel = 2; 57systemState.sceneSpeedLevel = 2; 58systemState.paletteSpeedLevel = 2; 59 60systemState.categoryRotationDelay = speedTable[2]; 61systemState.sceneRotationDelay = speedTable[2]; 62systemState.paletteRotationDelay = speedTable[2]; 63 64 65WiFi.mode(WIFI_STA); 66//========================================= 67// Débug 68//======================================== 69 70 Serial.println(); 71 Serial.println("MASTER READY"); 72 73 // Serial.print("Master sizeof(SystemData) = "); 74 // Serial.println(sizeof(SystemData)); 75 76//=========================================== 77 78Serial.println(); 79Serial.print("Adresse MAC du Master : "); 80Serial.println(WiFi.macAddress()); 81} 82 83//================================================ 84// Loop 85//================================================ 86 87void loop() 88{ 89 //-------------------------------- 90 // Réception FFT Processor 91 //-------------------------------- 92 93 receiveFFTData(); 94 95 //---------------------------------------------- 96 //debug 97 //--------------------------------------------- 98 99 //-------------------------------- 100 // Mise à jour du ruban 101 //-------------------------------- 102 103 updateAudioLab(); 104 105 //-------------------------------- 106 // Télécommande 107 //-------------------------------- 108 109 updateRF(); 110 111 //-------------------------------- 112// Commandes Terminal 113//-------------------------------- 114 115 updateRemoteManager(); 116 117 //-------------------------------- 118 // Réglave vitesse changement 119 //-------------------------------- 120 121 updateAutomaticModes(); 122 //-------------------------------- 123 // Mise à jour SystemData 124 //-------------------------------- 125 126 //-------------------------------- 127 // OLED (5 Hz) 128 //-------------------------------- 129 130 static uint32_t lastOLED = 0; 131 132 if(millis() - lastOLED >= 200) 133 { 134 lastOLED = millis(); 135 136 updateOLED(); 137 } 138 139 //-------------------------------- 140 // ESP-NOW (50 Hz) 141 //-------------------------------- 142 143 static uint32_t lastSync = 0; 144 145 if(millis() - lastSync >= 20) 146 { 147 lastSync = millis(); 148 149 sendSync(); 150 } 151 152 //-------------------------------- 153 // Synchronisation 154 //-------------------------------- 155 156 frameCount++; 157 158 //-------------------------------- 159 // Gestion des commandes 160 //-------------------------------- 161 162 if (terminalSelected()) 163{ 164 updateRemoteManager(); 165} 166else 167{ 168 updateRF(); 169} 170 171 //-------------------------------- 172 // Repos CPU 173 //-------------------------------- 174 175 delay(1); 176}
Downloadable files
Schéma de principe
Schéma de principe.jpg

Documentation
https://www.hackster.io/alain-delcourt/omegastar-900-led-esp32-s3-lighting-star-124a7c
Comments
Only logged in users can leave comments