#include #include constexpr unsigned milliSec {3}; constexpr bool DEBUG {false}; namespace MeineLed { constexpr unsigned frequency {5000}; // Hz constexpr unsigned resolution {10}; // Bit, 0...255 / 0...1023 /* const unsigned dimLed [] {0,0,0,0,0,0,0,0, 1,1,1,2,2,2,3,3,4,5,6,7,8,10,11,13,14,16,18,21,23,25,28,31,34, 37,40,43,47,51,55,59,63,67,72,77,82,87,93,98,104,110,116,123, 129,136,143,150,158,166,173,182,190,199,207,216,226,235,245,255}; */ const unsigned dimLed [] {0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,5,6,7,8,9,10,11,13,14,16,18,19,21,23,26,28,30, 33,35,38,41,44,47,50,54,57,61,64,68,72,77,81,85,90,95,100,105,110,115,121, 126,132,138,144,151,157,164,171,177,185,192,199,207,215,223,231,239,248, 257,265,274,284,293,303,313,322,333,343,354,364,375,386,398,409,421,433, 445,457,470,483,496,509,522,536,549,563,578,592,607,621,636,652,667,683, 699,715,731,748,765,782,799,816,834,852,870,889,907,926,945,965,984,1004,1023}; constexpr unsigned dimLedAnzahl { sizeof(dimLed) / sizeof(dimLed[0]) }; constexpr unsigned maxIndex {dimLedAnzahl-1}; } // --------------------------------------------------------------------------------------------------------- void init (const unsigned pin) { using namespace MeineLed; ledcAttach(pin, frequency, resolution); } constexpr unsigned ledList [] {D2, D3, D4, D5, D6}; // max. 5 Leds // --------------------------------------------------------------------------------------------------------- void setup (void) { Serial.begin(115200); for (unsigned i=D2; i