#include "SmartStrip.hpp" #define LEDSTRIPE_PIN 15 // D8 void SmartStrip::init() { FastLED.addLeds(leds, 15); reset(); } void SmartStrip::reset() { FastLED.clear(true); FastLED.show(); } void SmartStrip::setGreen(int led) { leds[led].setRGB(0, 2, 0); FastLED.show(); FastLED.show(); } void SmartStrip::animateBottomToTop(int r, int g, int b) { for (int i = 0; i <= 14; i++) { leds[i].setRGB(r, g, b); FastLED.show(); FastLED.show(); delay(100); } FastLED.clear(true); FastLED.show(); } void SmartStrip::progressBar(int min, int max, int val) { // starts at 14 and goes down to 0 as steeping continues int level = map(val, min, max, 0, 14); if (level != lastLevel) { lastLevel = level; // update strip for (int i = 14; i >= level; i--) { leds[i].setRGB(0, 0, 1); FastLED.show(); FastLED.show(); } } }