I've got some error?


see the above image and help me to sort out this

Please

  1. We can't see your code; post it using code tags as described in How to get the best out of this forum.
  2. We don't know which board you're using.
  3. Screenshots of error messages are useles; there should be a button "copy error messages" at the right of the orange bar. Use that to copy your error and past it here (again using code tags).

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.

ERROR
Arduino: 1.8.19 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), ck, 26 MHz, 40MHz, DOUT (compatible), 512K (no SPIFFS), 2, nonos-sdk 2.2.1 (legacy), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from C:\Users\Admin\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkApi.h:37:0,

             from C:\Users\Admin\OneDrive\Documents\Arduino\libraries\Blynk\src/BlynkApiArduino.h:14,

             from C:\Users\Admin\OneDrive\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp8266.h:24,

             from C:\Users\Admin\OneDrive\Documents\Arduino\parkingSystem.c\parkingSystem.c.ino:5:

C:\Users\Admin\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:36:21: error: redefinition of 'class BlynkTimer'

#define SimpleTimer BlynkTimer

                 ^

C:\Users\Admin\OneDrive\Documents\Arduino\libraries\SimpleTimer/SimpleTimer.h:10:7: note: in expansion of macro 'SimpleTimer'

class SimpleTimer {

   ^

C:\Users\Admin\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:36:21: error: previous definition of 'class BlynkTimer'

#define SimpleTimer BlynkTimer

                 ^

C:\Users\Admin\OneDrive\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:41:7: note: in expansion of macro 'SimpleTimer'

class SimpleTimer {

   ^

exit status 1

Error compiling for board Generic ESP8266 Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

#define BLYNK_PRINT Serial

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

char auth[] = "ac173b0527c94a91a6cde0dcdfe6bdef";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "ZONG MBB-E8231-6E63";
char pass[] = "08659650";

SimpleTimer timer;

String myString; // complete message from arduino, which consistors of snesors data
char rdata; // received charactors

int firstVal, secondVal,thirdVal; // sensors
int led1,led2,led3,led4,led5,led6;
// This function sends Arduino's up time every second to Virtual Pin (1).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V1, millis() / 1000);

}

void setup()
{
// Debug console
Serial.begin(9600);

Blynk.begin(auth, ssid, pass);

timer.setInterval(1000L,sensorvalue1); 
timer.setInterval(1000L,sensorvalue2); 
timer.setInterval(1000L,sensorvalue3);
timer.setInterval(1000L,sensorvalue4);
timer.setInterval(1000L,sensorvalue5);
timer.setInterval(1000L,sensorvalue6);

}

void loop()
{
if (Serial.available() == 0 )
{
Blynk.run();
timer.run(); // Initiates BlynkTimer
}

if (Serial.available() > 0 )
{
rdata = Serial.read();
myString = myString+ rdata;
// Serial.print(rdata);
if( rdata == '\n')
{
Serial.println(myString);
// Serial.println("fahad");
// new code
String l = getValue(myString, ',', 0);
String m = getValue(myString, ',', 1);
String n = getValue(myString, ',', 2);
String o = getValue(myString, ',', 3);
String p = getValue(myString, ',', 4);
String q = getValue(myString, ',', 5);

// these leds represents the leds used in Blynk application
led1 = l.toInt();
led2 = m.toInt();
led3 = n.toInt();
led4 = o.toInt();
led5 = p.toInt();
led6 = q.toInt();

myString = "";
// end new code
}
}

}

void sensorvalue1()
{
int sdata = led1;
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V10, sdata);

}
void sensorvalue2()
{
int sdata = led2;
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V11, sdata);

}

void sensorvalue3()
{
int sdata = led3;
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V12, sdata);

}

void sensorvalue4()
{
int sdata = led4;
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V13, sdata);

}

void sensorvalue5()
{
int sdata = led5;
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V14, sdata);

}

void sensorvalue6()
{
int sdata = led6;
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V15, sdata);

}

String getValue(String data, char separator, int index)
{
int found = 0;
int strIndex[] = { 0, -1 };
int maxIndex = data.length() - 1;

for (int i = 0; i <= maxIndex && found <= index; i++) {
    if (data.charAt(i) == separator || i == maxIndex) {
        found++;
        strIndex[0] = strIndex[1] + 1;
        strIndex[1] = (i == maxIndex) ? i+1 : i;
    }
}
return found > index ? data.substring(strIndex[0], strIndex[1]) : "";

}

See that [] in your code here on the forum? That's why you were asked to post using code tags; please read How to get the best out of this forum and please fix your previous post #3.

The multiple ".h" files refer to redundant entries, for example;

.../BlynkTimer.h:36:21: 
error: redefinition of 'class BlynkTimer'

Look through your .h files (or comment-out one .h entirely) to find the redundancy and re-compile.

Format your code in your post like this (I will remove this code block after you tidy-up your post):

#define BLYNK_PRINT Serial

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

char auth = "ac173b0527c94a91a6cde0dcdfe6bdef";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid = "ZONG MBB-E8231-6E63";
char pass = "08659650";

SimpleTimer timer;

String myString; // complete message from arduino, which consistors of snesors data
char rdata; // received charactors

int firstVal, secondVal, thirdVal; // sensors
int led1, led2, led3, led4, led5, led6;
// This function sends Arduino's up time every second to Virtual Pin (1).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.

void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V1, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);

  timer.setInterval(1000L, sensorvalue1);
  timer.setInterval(1000L, sensorvalue2);
  timer.setInterval(1000L, sensorvalue3);
  timer.setInterval(1000L, sensorvalue4);
  timer.setInterval(1000L, sensorvalue5);
  timer.setInterval(1000L, sensorvalue6);
}

void loop()
{
  if (Serial.available() == 0 )
  {
    Blynk.run();
    timer.run(); // Initiates BlynkTimer
  }

  if (Serial.available() > 0 )
  {
    rdata = Serial.read();
    myString = myString + rdata;
    // Serial.print(rdata);
    if ( rdata == '\n')
    {
      Serial.println(myString);
      // Serial.println("fahad");
      // new code
      String l = getValue(myString, ',', 0);
      String m = getValue(myString, ',', 1);
      String n = getValue(myString, ',', 2);
      String o = getValue(myString, ',', 3);
      String p = getValue(myString, ',', 4);
      String q = getValue(myString, ',', 5);

      // these leds represents the leds used in Blynk application
      led1 = l.toInt();
      led2 = m.toInt();
      led3 = n.toInt();
      led4 = o.toInt();
      led5 = p.toInt();
      led6 = q.toInt();

      myString = "";
      // end new code
    }
  }
}

void sensorvalue1()
{
  int sdata = led1;
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V10, sdata);
}
void sensorvalue2()
{
  int sdata = led2;
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V11, sdata);
}

void sensorvalue3()
{
  int sdata = led3;
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V12, sdata);
}

void sensorvalue4()
{
  int sdata = led4;
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V13, sdata);
}

void sensorvalue5()
{
  int sdata = led5;
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V14, sdata);
}

void sensorvalue6()
{
  int sdata = led6;
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V15, sdata);
}

String getValue(String data, char separator, int index)
{
  int found = 0;
  int strIndex = { 0, -1 };
  int maxIndex = data.length() - 1;

  for (int i = 0; i <= maxIndex && found <= index; i++) {
    if (data.charAt(i) == separator || i == maxIndex) {
      found++;
      strIndex[0] = strIndex[1] + 1;
      strIndex[1] = (i == maxIndex) ? i + 1 : i;
    }
  }
  return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.