#include #include "spore/Spore.h" #include "spore/util/Logging.h" #include "NeoPatternService.h" #include "NeoPixelConfig.h" // Configuration constants #ifndef NEOPIXEL_PIN #define NEOPIXEL_PIN 2 #endif #ifndef NEOPIXEL_LENGTH #define NEOPIXEL_LENGTH 8 #endif #ifndef NEOPIXEL_BRIGHTNESS #define NEOPIXEL_BRIGHTNESS 100 #endif #ifndef NEOPIXEL_UPDATE_INTERVAL #define NEOPIXEL_UPDATE_INTERVAL 100 #endif // Create Spore instance with custom labels Spore spore({ {"app", "neopattern"}, {"device", "led_strip"}, {"pixels", String(NEOPIXEL_LENGTH)}, {"pin", String(NEOPIXEL_PIN)} }); // Create custom service NeoPatternService* neoPatternService = nullptr; void setup() { // Initialize the Spore framework spore.setup(); // Create configuration NeoPixelConfig config( NEOPIXEL_PIN, NEOPIXEL_LENGTH, NEOPIXEL_BRIGHTNESS, NEOPIXEL_UPDATE_INTERVAL ); // Create and add custom service neoPatternService = new NeoPatternService(spore.getTaskManager(), config); spore.addService(neoPatternService); // Start the API server and complete initialization spore.begin(); LOG_INFO("Main", "NeoPattern service registered and ready!"); } void loop() { // Run the Spore framework loop spore.loop(); }