Help me to get online

Hi there, Im working to complete the Osoyoo smart home project,All the steps is right but i have a problem in library of BlynkSimpleYun.h is always black color and the system is offline untill i remove the console line and replase it with Serial,Please help :

Would you please re-post your firmware like this,

image

That’s the back-tick character (under the Esc key on my keyboard).

There is no problem with that… the coloring is irrelevant.

Repost your properly formatted code and confirm your App and Library versions, etc. As per requested when initially posting…


#define BLYNK_PRINT Console
#include <Bridge.h>
#include <Console.h>
#include <BlynkSimpleYun.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "d19ba44a2daf4ad4aa0124833294ff5b";
SimpleTimer timer;

//Widget LED
WidgetLED led4(V4); //register to virtual pin 4

//FLAME sensor
//connect to A2
int FlamePin = A2;  // This is for input pin
int Flame = 0;  // HIGH when FLAME Exposed

void FLAMESENSOR () {
  Console.println("FLAME SENSOR START!");
  Flame = analogRead(FlamePin);
  Console.print("flame_val = ");
  Console.println(Flame);   //The serial will print the smoke value
  if(Flame<=700)       // the point at which the state of LEDs change 
  {
    led4.on();
  }
  else
  {
    Console.println("No Fire!");
    led4.off();
  } 
    //delay(2000);
}

void setup()
{
  Blynk.begin(auth); 
  Bridge.begin();
  Console.begin();
  timer.setInterval(10000, FLAMESENSOR);
  while (!Console);{}
    
}

void loop() {
  // this is where the "polling" occurs
  timer.run();
  Blynk.run();

}

Is it stuck here?

while (!Console);{}

This would typically be written,

while (!Console) {
   ;
}

However, I don’t think the syntax is the issue.

Thank Wickedbeernut ,I changed it but the system is still offline .I think the problem came from the library of the Yun cause the include <BlynkSimpleYun.h> still indicate not identified in black color,the other library are colored in red.
They system be online when i delete the console commands ,I dont know why and where is the error.Please help

As it’s already been pointed-out before, THIS IS NOT A PROBLEM.

The way that the Arduino IDE displays some items in colour is controlled by the keywords.txt file in each included library. This is an optional feature that library developers can choose to add if they wish, and in the case of this library the developer obviously didn’t bother. It doesn’t change the functionality of the library in any way.

Pete.

1 Like

While() is a blocking command… until it’s qualifiers are met, no further processing is allowed.