M4_Eyes/user_wiichuck.cpp
void user_setup(StaticJsonDocument<2048> &doc) {
  low = getDocInt(doc, "wiichuck", "min", 0);
  high = getDocInt(doc, "wiichuck", "max", 255);
  divFactor = (high - low) / 3 + 1;
  Serial.println("user_setup(doc)");

  const char *neopin = doc["wiichuck"]["neopixel"]["pin"];
  Serial.println("neopin=" + String(neopin ? neopin : "(null)"));
  int32_t neomax = getDocInt(doc, "wiichuck", "neopixel", "max", -1);
  Serial.println("neopin=" + String(neomax));

  if(neopin && neomax > -1) {
    if((strcmp(neopin, "d2") == 0) || (strcmp(neopin, "D2") == 0))
      neoPixelPin = 2;
    else if((strcmp(neopin, "d3") == 0) || (strcmp(neopin, "D3") == 0))
      neoPixelPin = 3;
    neoPixelMax = neomax;

    strip.setPin(neoPixelPin);
    strip.updateLength(neoPixelMax);
    strip.updateType(NEO_GRB + NEO_KHZ800);
    strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
    strip.show();            // Turn OFF all pixels ASAP
    strip.begin();           // INITIALIZE NeoPixel strip object (REQUIRED)
  }    
}
// Called once after the processing of the configuration file. This allows
// user configuration to also be done via the config file.
Called once after the processing of the configuration file. This allows
user configuration to also be done via the config file.
Called once after the processing of the configuration file . This allows user configuration to also be done via the config file .
void user_setup(StaticJsonDocument<2048> &doc) {
  low = getDocInt(doc, "wiichuck", "min", 0);
  high = getDocInt(doc, "wiichuck", "max", 255);
  divFactor = (high - low) / 3 + 1;
  Serial.println("user_setup(doc)");
  const char *neopin = doc["wiichuck"]["neopixel"]["pin"];
  Serial.println("neopin=" + String(neopin ? neopin : "(null)"));
  int32_t neomax = getDocInt(doc, "wiichuck", "neopixel", "max", -1);
  Serial.println("neopin=" + String(neomax));
  if(neopin && neomax > -1) {
    if((strcmp(neopin, "d2") == 0) || (strcmp(neopin, "D2") == 0))
      neoPixelPin = 2;
    else if((strcmp(neopin, "d3") == 0) || (strcmp(neopin, "D3") == 0))
      neoPixelPin = 3;
    neoPixelMax = neomax;
    strip.setPin(neoPixelPin);
    strip.updateLength(neoPixelMax);
    strip.updateType(NEO_GRB + NEO_KHZ800);
    strip.setBrightness(50); 
    strip.show();            
    strip.begin();           
  }    
}
void user_setup ( StaticJsonDocument < 2048 > & doc ) { low = getDocInt ( doc , " " , " " , 0 ) ; high = getDocInt ( doc , " " , " " , 255 ) ; divFactor = ( high - low ) / 3 + 1 ; Serial . println ( " " ) ; const char * neopin = doc [ " " ] [ " " ] [ " " ] ; Serial . println ( " " + String ( neopin ? neopin : " " ) ) ; int32_t neomax = getDocInt ( doc , " " , " " , " " , -1 ) ; Serial . println ( " " + String ( neomax ) ) ; if ( neopin && neomax > -1 ) { if ( ( strcmp ( neopin , " " ) == 0 ) || ( strcmp ( neopin , " " ) == 0 ) ) neoPixelPin = 2 ; else if ( ( strcmp ( neopin , " " ) == 0 ) || ( strcmp ( neopin , " " ) == 0 ) ) neoPixelPin = 3 ; neoPixelMax = neomax ; strip . setPin ( neoPixelPin ) ; strip . updateLength ( neoPixelMax ) ; strip . updateType ( NEO_GRB + NEO_KHZ800 ) ; strip . setBrightness ( 50 ) ; strip . show ( ) ; strip . begin ( ) ; } }
Called once after the processing of the configuration file.
Called once after the processing of the configuration file .
// Set BRIGHTNESS to about 1/5 (max = 255) // Turn OFF all pixels ASAP // INITIALIZE NeoPixel strip object (REQUIRED)