BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Issue with connection and NodeMCU V3

Hello,

My NodeMCU keeps disconnecting and this function doesn’t work.

I have a NodeMCU V3 and I have a project that outputs to a RGB LED strip. All of the rest of my code works fine. The issue arises when I add in the functionality to get results from a small electret microphone. I am calling a function in the void loop() continuously. (I have another main control on a timer that changes which function I call in the void loop() so that I don’t flood the server but I still need the nodeMCU to output stuff to my lights while I am not sending/receiving data from Blynk)

I have my desired task working fine on an arduino and the nodeMCU offline.

I am only including the code of the function that I am accessing from the void loop() that uses data from the microphone (mostly because the code is pretty long). Note that I do not believe I am sending or requesting anything from Blynk in this particular function, all it uses is the 3 colors i get from a split zeRGBa that has BLYNK_WRITE for 3 virtual pins as well as a couple menu selections to tell my program to call this function in the main loop.

This code is by no means optimized, I am trying to “simulate” a while loop so that I can still have Blynk connectivity and the user can change the menu options without having to worry about being stuck in the while loop. The function is adapted from this code from Adafruit, if you think my code is not actually simulating this while loop feel free to correct me. (I did however just try the while loop and didnt change my menu options during it and I was getting the same issues).

Whew that was lengthy but this is a pretty specific issue.

(initAudioListen is initalized to true)
Here is the code:

void rise_one_color()
{
  if( initAudioListen == true )
  {
   startMillis = millis();  // Start of sample window
   peakToPeak = 0;   // peak-to-peak level
 
   signalMax = 0;
   signalMin = 1024;
  }

  if( millis() - startMillis < sampleWindow )
  {
    initAudioListen = false;
      
    sample = analogRead( A0 );

      if( sample < 1024 )  // toss out spurious readings
      {
         if( sample > signalMax )
         {
            signalMax = sample;  // save just the max levels
         }
         else if( sample < signalMin )
         {
            signalMin = sample;  // save just the min levels
         }
      }   // end of checking levels
  } // end of checking sampleWindow threshold
  else
  {
    initAudioListen = true; // done with sample, initialize again
  }


   if( initAudioListen == true )
   {
       peakToPeak = signalMax - signalMin;  // max - min = peak-peak amplitude
  
       double volts = (peakToPeak * 3.3) / 1024;  // convert to volts
  
  
       if( volts >= .15 ) // if over threshold, brighten the leds
       {          
            tempMusicRedVal = (musicRedVal * 3);
            tempMusicGrnVal = (musicGrnVal * 3);
            tempMusicBluVal = (musicBluVal * 3);
        
           analogWrite( redPin, tempMusicRedVal );  // LEDs get brighter if threshold is met
           analogWrite( grnPin, tempMusicGrnVal );
           analogWrite( bluPin, tempMusicBluVal );        
       }
       else // if not above the threshold go dim
       { 
           analogWrite( redPin, musicRedVal );  // LEDs stay dim
           analogWrite( grnPin, musicGrnVal );
           analogWrite( bluPin, musicBluVal );
       } // end of volts check
   }      
} // end of rise_one_color()

Thanks in advance! I would really appreciate any help. If you have any questions, just ask!

Paste up your entire code as that snippet doesn’t really help with the issue.

Even when it has no function calls (besides analogRead, my first suspect…) or writing/reading to virtual pins?

You’re asking for help aren’t you?

More or less was wondering what outside of the function could affect it.

Here is the version I am testing now. It is “watered down” so that is simple to view but I left all the working parts and still having issue. You might notice some paths to no where but normally they are attached to more code, just want to get it to work by itself first.

/*********************************************************
 * 
 * WiFi RGB LED Strip Controller
 * 
 * NodeMCU w/ Blynk app
 * 
**********************************************************/

#include <ESP8266WiFi.h>
#include <SimpleTimer.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = ""; // this is filled in... dont want to give out my auth token

char ssid[] = ""; // these are filled in.... just took them out so you dont know my wifi info lol...
char pass[] = "";

SimpleTimer timer;

WidgetLCD lcdV10( V10 ); // LCD screen on the Manual Control tab
WidgetLCD lcdV11( V11 ); // LCD screen on the Presets tab
WidgetLCD lcdV12( V12 ); // LCD screen on the Music Reactive tab

// *** Program Variables ***
String modeSelector = "SELECT"; // SELECT, NONE, MANUAL, PRESET, MUSIC
String musicSelector = "SELECT"; // SELECT, NONE, RISE_ONE_COLOR, DIM_ONE_COLOR, etc.

int redPin = 5; // NodeMCU pin D1
int grnPin = 4; // NodeMCU pin D2
int bluPin = 0; // NodeMCU pin D3

int redVal = 0;
int grnVal = 0;
int bluVal = 0;

int musicRedVal = 0;
int musicGrnVal = 0;
int musicBluVal = 0;

int tempMusicRedVal = 0;
int tempMusicGrnVal = 0;
int tempMusicBluVal = 0;

unsigned long oldMillis = 0; // going to set to millis()
unsigned long newMillis = 0;
unsigned long checkMillis = 0;




// Microphone variables
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;
int threshold = 3;
int delayTimer = threshold;
bool initAudioListen = true;

   unsigned long startMillis = 0;  // Start of sample window
   unsigned int peakToPeak = 0;   // peak-to-peak level
 
   unsigned int signalMax = 0;
   unsigned int signalMin = 0;
 



void setup()
{
  Serial.begin( 9600 ); // try testing this with it commented out?
  Blynk.begin( auth, ssid, pass );

 // Blynk.syncAll();

  timer.setInterval( 100L, mainControl ); // Accesses function "mainControl" every 100 ms
 
} // end of setup()





// Menu widget "Mode Selector" attached to virtual pin 0. Sets the other Mode Selector menus to the same index
BLYNK_WRITE( V0 )         
{
  switch (param.asInt())
  {
case 1:                        // Item 1: "---"
  modeSelector = "NONE";  
  Blynk.virtualWrite( V1, 1 );    // Sync other Mode Selector menus 
  Blynk.virtualWrite( V2, 1 );
  break;
case 2:                        // Item 2: "Manual Control"
  modeSelector = "MANUAL";
  Blynk.virtualWrite( V1, 2 );
  Blynk.virtualWrite( V2, 2 );
  break;
case 3:                        // Item 3: "Presets"
  modeSelector = "PRESET";
  Blynk.virtualWrite( V1, 3 );
  Blynk.virtualWrite( V2, 3 );
  break;
case 4:                        // Item 4: "Music"
  modeSelector = "MUSIC";
  Blynk.virtualWrite( V1, 4 );
  Blynk.virtualWrite( V2, 4 );
  break;
default:
  modeSelector = "NONE"; 
  break;
  }   

  updateLCDs();
  
} // end of blynk_write v0




// Menu widget "Mode Selector" attached to virtual pin 1. Sets the other Mode Selector menus to the same index
BLYNK_WRITE( V1 )         
{
  switch (param.asInt())
  {
case 1:                        // Item 1: "---"
  modeSelector = "NONE";  
  Blynk.virtualWrite( V0, 1 );    // Sync other Mode Selector menus 
  Blynk.virtualWrite( V2, 1 );
  break;
case 2:                        // Item 2: "Manual Control"
  modeSelector = "MANUAL";
  Blynk.virtualWrite( V0, 2 );
  Blynk.virtualWrite( V2, 2 );
  break;
case 3:                        // Item 3: "Presets"
  modeSelector = "PRESET";
  Blynk.virtualWrite( V0, 3 );
  Blynk.virtualWrite( V2, 3 );
  break;
case 4:                        // Item 4: "Music"
  modeSelector = "MUSIC";
  Blynk.virtualWrite( V0, 4 );
  Blynk.virtualWrite( V2, 4 );  
  break;
default:
  modeSelector = "NONE";
  break;
  }    

  updateLCDs();
  
} // end of blynk_write v1





// Menu widget "Mode Selector" attached to virtual pin 2. Sets the other Mode Selector menus to the same index
BLYNK_WRITE( V2 )         
{
  switch (param.asInt())
  {
case 1:                        // Item 1: "---"
  modeSelector = "NONE";
  Blynk.virtualWrite( V0, 1 );    // Sync other Mode Selector menus 
  Blynk.virtualWrite( V1, 1 );
  break;
case 2:                        // Item 2: "Manual Control"
  modeSelector = "MANUAL";
  Blynk.virtualWrite( V0, 2 );
  Blynk.virtualWrite( V1, 2 );
  break;
case 3:                        // Item 3: "Presets"
  modeSelector = "PRESET";
  Blynk.virtualWrite( V0, 3 );
  Blynk.virtualWrite( V1, 3 );
  break;
case 4:                        // Item 4: "Music"
  modeSelector = "MUSIC";
  Blynk.virtualWrite( V0, 4 );
  Blynk.virtualWrite( V1, 4 );
  break;
default:
  modeSelector = "NONE";  
  break;
  }    

  updateLCDs();
  
} // end of blynk_write v2



BLYNK_WRITE( V3 ) // manual red slider
{
  redVal = param.asInt(); // get the value on the red slider as an integer
}

BLYNK_WRITE( V4 ) // manual green slider
{
  grnVal = param.asInt(); // get the value on the green slider as an integer
}

BLYNK_WRITE( V5) // manual blue slider
{
  bluVal = param.asInt(); // get the value on the blue slider as an integer
}






BLYNK_WRITE( V7 ) // music mode selector
{
  switch (param.asInt())
  {
case 1:                        
  musicSelector = "NONE";
  break;
 case 2:                        
  musicSelector = "RISE_ONE_COLOR";
  break;
default:
  musicSelector = "SELECT";
  break;
  } 
}








BLYNK_WRITE( V20 )  // zeRGBa red color
{
  musicRedVal = param.asInt();
}

BLYNK_WRITE( V21 )  // zeRGBa green color
{
  musicGrnVal = param.asInt();
}

BLYNK_WRITE( V22 )  // zeRGBa blue color
{
  musicBluVal = param.asInt();
}







void mainControl()                  
{
  if( modeSelector == "MANUAL" )
  {
manualMode(); // Send to the manual control handler
  }  
} // end of mainControl function










void updateLCDs()   // *** OPTIMIZE ***
{
  if( modeSelector != "MANUAL" )  // updating the LCD for Manual Control tab 
  {
lcdV10.clear();
lcdV10.print( 0, 0, "Remember To Turn" );
lcdV10.print( 1, 1, "On Manual Mode" );
  }
  else if( modeSelector == "MANUAL" )
  {
lcdV10.clear();
lcdV10.print( 1, 0, "Manual Control" );
  }

  if( modeSelector != "PRESET" )  // updating the LCD for Manual Control tab 
  {
lcdV11.clear();
lcdV11.print( 0, 0, "Remember To Turn" );
lcdV11.print( 1, 1, "On Preset Mode" );
  }
  else if( modeSelector == "PRESET" )
  {
lcdV11.clear();
lcdV11.print( 4, 0, "Presets" );
  }

  if( modeSelector != "MUSIC" )  // updating the LCD for Manual Control tab 
  {
lcdV12.clear();
lcdV12.print( 0, 0, "Remember To Turn" );
lcdV12.print( 1, 1, "On Music Mode" );
  }
  else if( modeSelector == "MUSIC" )
  {
lcdV12.clear();
lcdV12.print( 1, 0, "Music Reactive" );
  }  
} // end of updateLCDs





void manualMode()
{   
   analogWrite( redPin, redVal );
   analogWrite( grnPin, grnVal );
   analogWrite( bluPin, bluVal );
}





void rise_one_color()
{
  if( initAudioListen == true )
  {
   startMillis = millis();  // Start of sample window
   peakToPeak = 0;   // peak-to-peak level
 
   signalMax = 0;
   signalMin = 1024;
  }

  if( millis() - startMillis < sampleWindow )
  {
initAudioListen = false;
  
sample = analogRead( A0 );

  if( sample < 1024 )  // toss out spurious readings
  {
     if( sample > signalMax )
     {
        signalMax = sample;  // save just the max levels
     }
     else if( sample < signalMin )
     {
        signalMin = sample;  // save just the min levels
     }
  }   // end of checking levels
  } // end of checking sampleWindow threshold
  else
  {
initAudioListen = true; // done with sample, initialize again
  }


   if( initAudioListen == true )
   {
   peakToPeak = signalMax - signalMin;  // max - min = peak-peak amplitude
  
   double volts = (peakToPeak * 3.3) / 1024;  // convert to volts
  
  
   if( volts >= .15 ) // if over threshold, brighten the leds
   {          
        tempMusicRedVal = (musicRedVal * 3);
        tempMusicGrnVal = (musicGrnVal * 3);
        tempMusicBluVal = (musicBluVal * 3);
    
       analogWrite( redPin, tempMusicRedVal );  // LEDs get brighter if threshold is met
       analogWrite( grnPin, tempMusicGrnVal );
       analogWrite( bluPin, tempMusicBluVal );        
   }
   else // if not above the threshold go dim
   { 
       analogWrite( redPin, musicRedVal );  // LEDs stay dim
       analogWrite( grnPin, musicGrnVal );
       analogWrite( bluPin, musicBluVal );
   } // end of volts check
   }      
} // end of rise_one_color()










// *** DEFAULT LOOP ***
void loop()
{
  Blynk.run();
  timer.run();

  if( modeSelector == "MUSIC" )
  {
if( musicSelector == "RISE_ONE_COLOR" )
{
  rise_one_color();
}
  }
} // end of loop

Any chance you could clone your project for me? I have made some changes but want to debug before I post here.

The app portion?

Ps if I dont reply I will in the morning, 3:30 am here lol

yes please…

All good its 1030pm here (in the future to you!)… so I will probably give it a shot as I have the nodemcu v3 (which as crap by the way) then head to bed myself :sleeping:

@bmoe24x they just seem to be more problematic than the WeMos.

2 Likes

The ESP8266 is great yes, but the NodeMCU dev board is power hungry. I could never run mind from a norm USB port. Also the grounding is pretty bad.

Go with the WeMos (clones are good too) version (or Mini-ESP as China websites call them)

Got the image.

1 Like

Oh okay I see. I am a computer engineering student and am making this controller for my apartment. Mostly I am getting into this to make myself learn more about the hardware side of things and the NodeMCU looked like the easiest/quickest way to get things up and running. I have mine being powered from a step down voltage converter so seems fine, also worked fine off my computer’s usb and a usb from wall adapter. I will look into WeMos. Any conclusion on your findings?

Unfortunately not… but I’ll have a crack at it in the morning :slight_smile:

Okay thank you. Even narrowing down to where the issue is hardware/software/where in the software would be a big help. Trying not to get discouraged and actually finish this thing :raised_hands:t3:

Update: Not sure if this tells me it is software side or that the mic is drawing too much power or something but if I comment out the analogRead( A0 ); the board doesn’t disconnect…

1 Like

@Costas do you have any suggestions of how to go about solving this issue?

So I’ve had another go at it this morning… not sure what the hell is going on with your project… it could be the cloned app itself causing issues but its just not responding to any virtual pin actions.

Im going to my parents farm today but when I get back I will have a go at creating a new project in my app and seeing if it helps.

Does it work before you put it in music reactive mode? It isn’t synced right now so try manual control and see if the lcd’s are updated. The issue comes when putting it in music reactive mode with fade on beat - one color selected, it consistently disconnects thus not allowing any virtual pins to be updated. I noticed if i took out my analogRead the app doesnt disconnect btw

I can’t even get the menus to work!

I have put in some Serial debug lines and yet nothing happens!
I’m really stumped actually… but my wife is demanding i get off the computer and get ready to go lol so I would LOVE to stay and keep trying but yeh… happy wife, happy life! :smile:

Here is my code… cleaned up slightly and added Serial debugging.

/*********************************************************

   WiFi RGB LED Strip Controller

   NodeMCU w/ Blynk app

**********************************************************/
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <SimpleTimer.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "xxxxxxxx";
char ssid[] = "xxxxxxxx";
char pass[] = "xxxxxxxx";

SimpleTimer timer;

WidgetLCD lcdV10( V10 ); // LCD screen on the Manual Control tab
WidgetLCD lcdV11( V11 ); // LCD screen on the Presets tab
WidgetLCD lcdV12( V12 ); // LCD screen on the Music Reactive tab

// *** Program Variables ***
String modeSelector = "SELECT"; // SELECT, NONE, MANUAL, PRESET, MUSIC
String musicSelector = "SELECT"; // SELECT, NONE, RISE_ONE_COLOR, DIM_ONE_COLOR, etc.
int redPin = 5; // NodeMCU pin D1
int grnPin = 4; // NodeMCU pin D2
int bluPin = 0; // NodeMCU pin D3
int redVal = 0,          grnVal = 0,            bluVal = 0;
int musicRedVal = 0,     musicGrnVal = 0,       musicBluVal = 0;
int tempMusicRedVal = 0, tempMusicGrnVal = 0,   tempMusicBluVal = 0;
unsigned long oldMillis = 0, newMillis = 0, checkMillis = 0; // going to set to millis()
// Microphone variables
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;
int threshold = 3;
int delayTimer = threshold;
bool initAudioListen = true;
unsigned long startMillis = 0;  // Start of sample window
unsigned int peakToPeak = 0;   // peak-to-peak level
unsigned int signalMax = 0, signalMin = 0;

void setup() {
  Serial.begin(115200); 
  Blynk.begin(auth, ssid, pass);
  //Blynk.begin(auth, ssid, pass, IPAddress(192, 168, 1, 2)); // local server
  timer.setInterval( 100L, mainControl ); // Accesses function "mainControl" every 100 ms
}

// Menu widget "Mode Selector" attached to virtual pin 0. Sets the other Mode Selector menus to the same index
BLYNK_WRITE(0) {
  Serial.println(param.asInt());
  switch (param.asInt()) {
    case 1:                        // Item 1: "---"
      modeSelector = "NONE";
      Blynk.virtualWrite( V1, 1 );    // Sync other Mode Selector menus
      Blynk.virtualWrite( V2, 1 );
      break;
    case 2:                        // Item 2: "Manual Control"
      modeSelector = "MANUAL";
      Blynk.virtualWrite( V1, 2 );
      Blynk.virtualWrite( V2, 2 );
      break;
    case 3:                        // Item 3: "Presets"
      modeSelector = "PRESET";
      Blynk.virtualWrite( V1, 3 );
      Blynk.virtualWrite( V2, 3 );
      break;
    case 4:                        // Item 4: "Music"
      modeSelector = "MUSIC";
      Blynk.virtualWrite( V1, 4 );
      Blynk.virtualWrite( V2, 4 );
      break;
    default:
      modeSelector = "NONE";
      break;
  }
  updateLCDs();
  Serial.println(modeSelector);
}

// Menu widget "Mode Selector" attached to virtual pin 1. Sets the other Mode Selector menus to the same index
BLYNK_WRITE(1) {
  Serial.println(param.asInt());
  switch (param.asInt()) {
    case 1:                        // Item 1: "---"
      modeSelector = "NONE";
      Blynk.virtualWrite( V0, 1 );    // Sync other Mode Selector menus
      Blynk.virtualWrite( V2, 1 );
      break;
    case 2:                        // Item 2: "Manual Control"
      modeSelector = "MANUAL";
      Blynk.virtualWrite( V0, 2 );
      Blynk.virtualWrite( V2, 2 );
      break;
    case 3:                        // Item 3: "Presets"
      modeSelector = "PRESET";
      Blynk.virtualWrite( V0, 3 );
      Blynk.virtualWrite( V2, 3 );
      break;
    case 4:                        // Item 4: "Music"
      modeSelector = "MUSIC";
      Blynk.virtualWrite( V0, 4 );
      Blynk.virtualWrite( V2, 4 );
      break;
    default:
      modeSelector = "NONE";
      break;
  }
  updateLCDs();
  Serial.println(modeSelector);
}

// Menu widget "Mode Selector" attached to virtual pin 2. Sets the other Mode Selector menus to the same index
BLYNK_WRITE( V2 ) {
  Serial.println(param.asInt());
  switch (param.asInt()) {
    case 1:                        // Item 1: "---"
      modeSelector = "NONE";
      Blynk.virtualWrite( V0, 1 );    // Sync other Mode Selector menus
      Blynk.virtualWrite( V1, 1 );
      break;
    case 2:                        // Item 2: "Manual Control"
      modeSelector = "MANUAL";
      Blynk.virtualWrite( V0, 2 );
      Blynk.virtualWrite( V1, 2 );
      break;
    case 3:                        // Item 3: "Presets"
      modeSelector = "PRESET";
      Blynk.virtualWrite( V0, 3 );
      Blynk.virtualWrite( V1, 3 );
      break;
    case 4:                        // Item 4: "Music"
      modeSelector = "MUSIC";
      Blynk.virtualWrite( V0, 4 );
      Blynk.virtualWrite( V1, 4 );
      break;
    default:
      modeSelector = "NONE";
      break;
  }
  updateLCDs();
}


BLYNK_WRITE(3) { // manual red slider
  redVal = param.asInt(); // get the value on the red slider as an integer
  Serial.println(param.asInt());
}

BLYNK_WRITE(4) {// manual green slider
  grnVal = param.asInt(); // get the value on the green slider as an integer
 Serial.println(param.asInt());
}

BLYNK_WRITE(5) {// manual blue slider
  bluVal = param.asInt(); // get the value on the blue slider as an integer
  Serial.println(param.asInt());
}

BLYNK_WRITE(7) {// music mode selector
  switch (param.asInt()) {
    case 1:
      musicSelector = "NONE";
      break;
    case 2:
      musicSelector = "RISE_ONE_COLOR";
      break;
    default:
      musicSelector = "SELECT";
      break;
  }
  Serial.println(musicSelector);
}

BLYNK_WRITE(20) { // zeRGBa red color
  musicRedVal = param.asInt();
  Serial.println(musicRedVal);
}

BLYNK_WRITE(21) { // zeRGBa green color
  musicGrnVal = param.asInt();
  Serial.println(musicGrnVal);
}

BLYNK_WRITE(22) { // zeRGBa blue color
  musicBluVal = param.asInt();
  Serial.println(musicBluVal);
}

void mainControl()
{
  if ( modeSelector == "MANUAL" ) {
    manualMode(); // Send to the manual control handler
  }
} // end of mainControl function

void updateLCDs()   // *** OPTIMIZE ***
{
  if ( modeSelector != "MANUAL" ) { // updating the LCD for Manual Control tab
    lcdV10.clear();
    lcdV10.print( 0, 0, "Remember To Turn" );
    lcdV10.print( 1, 1, "On Manual Mode" );
  } else if ( modeSelector == "MANUAL" ) {
    lcdV10.clear();
    lcdV10.print( 1, 0, "Manual Control" );
  }

  if ( modeSelector != "PRESET" ) { // updating the LCD for Manual Control tab
    lcdV11.clear();
    lcdV11.print( 0, 0, "Remember To Turn" );
    lcdV11.print( 1, 1, "On Preset Mode" );
  }
  else if ( modeSelector == "PRESET" ) {
    lcdV11.clear();
    lcdV11.print( 4, 0, "Presets" );
  }

  if ( modeSelector != "MUSIC" ) { // updating the LCD for Manual Control tab
    lcdV12.clear();
    lcdV12.print( 0, 0, "Remember To Turn" );
    lcdV12.print( 1, 1, "On Music Mode" );
  } else if ( modeSelector == "MUSIC" ) {
    lcdV12.clear();
    lcdV12.print( 1, 0, "Music Reactive" );
  }
}

void manualMode() {
  analogWrite( redPin, redVal );
  analogWrite( grnPin, grnVal );
  analogWrite( bluPin, bluVal );
}

void rise_one_color() {

  if ( initAudioListen == true ) {
    startMillis = millis();  // Start of sample window
    peakToPeak = 0;   // peak-to-peak level
    signalMax = 0;
    signalMin = 1024;
  }

  if ( millis() - startMillis < sampleWindow ) {
    initAudioListen = false;
    sample = analogRead( A0 );
    if ( sample < 1024 ) {
      if ( sample > signalMax ) {
        signalMax = sample;
      } else if ( sample < signalMin ) {
        signalMin = sample;
      }
    }
  } else  {
    initAudioListen = true;
  }

  if ( initAudioListen == true )  {
    peakToPeak = signalMax - signalMin;
    double volts = (peakToPeak * 3.3) / 1024;
    if ( volts >= 0.15 ) {
      tempMusicRedVal = (musicRedVal * 3);
      tempMusicGrnVal = (musicGrnVal * 3);
      tempMusicBluVal = (musicBluVal * 3);
      analogWrite( redPin, tempMusicRedVal );  // LEDs get brighter if threshold is met
      analogWrite( grnPin, tempMusicGrnVal );
      analogWrite( bluPin, tempMusicBluVal );
    } else  {
      analogWrite( redPin, musicRedVal );  // LEDs stay dim
      analogWrite( grnPin, musicGrnVal );
      analogWrite( bluPin, musicBluVal );
    }
  }
}

void loop() {
  Blynk.run();
  timer.run();
  if ( modeSelector == "MUSIC" && musicSelector == "RISE_ONE_COLOR" ) {
    rise_one_color();
  }
}

Haha no problem I appreciate the help. Seems odd that they don’t work! Working just fine for me

Got a feeling its the new iOS update… you don’t happen to use Android?
I read in the latest iOS update thread that there may be some issue with cloning projects between the 2 operating systems right now… hence ill try and recrete the project myself later :smiley:

No I am using iOS (I have an android tablet if I need to crack it out) but haven’t updated the app yet. To test the music reactive mode you would just need the zeRGBa and 2 menu widgets with their respective virtual pins I think. Thanks again

1 Like