error in the code please suggest me the write code for controlling the led

Arduino: 1.8.13 (Windows 10), Board: “NodeMCU 0.9 (ESP-12 Module), 160 MHz, 115200, 4M (3M SPIFFS)”

rgb_led:8:26: error: 'led1' was not declared in this scope

 const int FieldNumber1 = led1 ; 

                          ^

rgb_led:9:26: error: 'led2' was not declared in this scope

 const int FieldNumber2 = led2 ;

                          ^

rgb_led:10:26: error: 'led3' was not declared in this scope

 const int FieldNumber3 = led3 ;

                          ^

rgb_led:13:9: error: redefinition of 'uint8_t LEDpin'

 uint8_t LEDpin = D7;

         ^

rgb_led:12:9: error: 'uint8_t LEDpin' previously defined here

 uint8_t LEDpin = D6;

         ^

rgb_led:14:9: error: redefinition of 'uint8_t LEDpin'

 uint8_t LEDpin = D8;

         ^

rgb_led:12:9: error: 'uint8_t LEDpin' previously defined here

 uint8_t LEDpin = D6;

         ^

C:\Users\Asus\Documents\Arduino\rgb_led\rgb_led.ino: In function 'void loop()':

rgb_led:44:20: error: 'led1' was not declared in this scope

     Serial.println(led1);

                    ^

rgb_led:49:7: error: redeclaration of 'int A'

   int A = ThingSpeak.readLongField(counterChannelNumber, FieldNumber3, myCounterReadAPIKey);

       ^

rgb_led:40:7: error: 'int A' previously declared here

   int A = ThingSpeak.readLongField(counterChannelNumber, FieldNumber1, myCounterReadAPIKey);

       ^

rgb_led:53:20: error: 'led2' was not declared in this scope

     Serial.println(led2);

                    ^

rgb_led:58:7: error: redeclaration of 'int A'

   int A = ThingSpeak.readLongField(counterChannelNumber, FieldNumber3, myCounterReadAPIKey);

       ^

rgb_led:40:7: error: 'int A' previously declared here

   int A = ThingSpeak.readLongField(counterChannelNumber, FieldNumber1, myCounterReadAPIKey);

       ^

rgb_led:62:20: error: 'led3' was not declared in this scope

     Serial.println(led3);

                    ^

exit status 1

'led1' was not declared in this scope



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

and this is my code

#include <ThingSpeak.h>               // add librery
#include <ESP8266WiFi.h>

WiFiClient  client;
unsigned long counterChannelNumber = 1027878;                // Channel ID
const char * myCounterReadAPIKey = "CXADD6SZ5W4RKRHD";
                                                      // Read API Key
const int FieldNumber1 = led1 ; 
const int FieldNumber2 = led2 ;
const int FieldNumber3 = led3 ;
                                     // The field you wish to read
uint8_t LEDpin = D6;
uint8_t LEDpin = D7;
uint8_t LEDpin = D8;

unsigned int presentValue = 0;
unsigned int changeValue = 0;

void setup()
{
  Serial.begin(115200);
  Serial.println();

  WiFi.begin("POCO PHONE", "9004652173");                 // write wifi name & password

  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
  ThingSpeak.begin(client);
}

void loop()
{
  int A = ThingSpeak.readLongField(counterChannelNumber, FieldNumber1, myCounterReadAPIKey);
  presentValue = A;
  if (presentValue != changeValue)
  {
    Serial.println(led1);
    analogWrite(LEDpin , A);
    changeValue = presentValue;
  }

  int A = ThingSpeak.readLongField(counterChannelNumber, FieldNumber3, myCounterReadAPIKey);
  presentValue = A;
  if (presentValue != changeValue)
  {
    Serial.println(led2);
    analogWrite(LEDpin , A);
    changeValue = presentValue;
  }

  int A = ThingSpeak.readLongField(counterChannelNumber, FieldNumber3, myCounterReadAPIKey);
  presentValue = A;
  if (presentValue != changeValue)
  {
    Serial.println(led3);
    analogWrite(LEDpin , A);
    changeValue = presentValue;
  }
}

read the forum guidelines at the top of every section. Edit your post to include code tags.

Welcome to the Forum. Start by reading the stickies at the top of every section which tell you how to post on the forum and what information to provide. This will help others to help you get the answer you need.

In particular make sure that your code is inside code tags. You can edit a post to include them. If the code is too big attach it as a file or create a smaller code that is able to compile and incudes the problem (do not use snippets).

Hello SupritSahoo,
Welcome to the Arduino fora. I and the other people here want to help you but to do that we need certain bits of information. Without the correct information it is difficult or impossible to give you the help and advice you need. To help us to help you please read General guidance andHow to use this forum and provide the information asked for. Being new here you might think this is asking too much or having rules for the sake of rules, that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of message while we try to get you to tell us what we need in order to help you, this is frustrating for you and frustrating for us.

Common mistakes for people posting here the first time:
Code problems:
Not posting any code while expecting us to work out what is wrong with your code; we are not telepathic and can only find problems in code we can see.
Posting a snippet of code in the belief that the problem is in the code snippet. It is almost always the case that the problem is not where you think it is but elsewhere in the code, hence we need all the code.
Not correctly formatting code. Before posting code use Tools / auto format at the top of the IDE, or use control T. Once you’ve done that use edit / copy for forum.
Posting code without code tags (</>), these are explained in the instructions linked to above. Using code tags makes the code easier to read. Not using code tags means some of the code gets interpreted as HTML with the result that it is displayed with smiley faces and other stuff that should not be there.
Asking for complete code; we are not here to write code for you, we are here to help you if you get stuck writing code yourself. If you really want someone to write code for you please click on ‘report to moderator’ and ask them to move this to ‘Gigs and Collaborations’ and indicate how much you are willing to pay.

Schematics:
The language of electronics is a schematic or circuit diagram. Long descriptions of what is connected to what are generally useless. A schematic is a drawing of what connects to what, please make one and photograph it. We don’t mind if it’s hand drawn, scruffy and does not use the correct symbols. We do mind if you don’t at least try to post a schematic. Please read How to post an image

Questions:
Not being clear about what is being asked, for example not asking a question at all or asking a vague question like ‘please help’ or some such thing.

About us:
Those of us answering questions have a wide variety of backgrounds and electronics knowledge, some though working in electronics, some through electronics as a hobby, some both. Most of us are not trained as teachers so probably miss the finer points of how to teach and explain things effectively. We are not, with the odd exception, employees or representatives of Arduino.
Please also remember we are volunteers doing this for free in our spare time and are more inclined to help people who make it easy for us to provide help by providing the information we ask for.

About you:
We only know about you what you tell us; we need to know your level of experience with electronics or microcontrollers, if we don’t know then we can’t tailor our answer to your level of knowledge. We also don’t know if you have problems with English or language or communications in general unless you tell us. We can be sympathetic about problems we know about, but if you don’t tell us we don’t know.

Thank you.

ok thanks

I HAVE WRITTEN THE CODE TO OPERATE THE RGB LED STRIP, ALL MY HARDWARE ARE WORKING PROPERLY, BUT I HAVE CODE THAT ONLY WORKS FOR THE SINGLE LED TO USE IT AS DIMMER WITH HELP OF THING-SPEAK AND MIT APP INVENTOR BUT I WANT TO CONTROL THE 3 LEDS THAT IS ‘RGB’ TO USE AS DIMMER TO CONTROL IT INDIVIDUALLY AND HAVE GOOD COLOR COMBINATION.

BUT THERE IS ERRORS IN MY CODE WHICH I CANT UNDERSTAND PLEASE CHECK IT OUT AND GIVE REPLY TO THE ERROR POINTS SO THAT I CAN CORRECT IT

PLEASE CHECK BELOW THE ATTACHMENT
THANKS

rgb_led.ino (1.75 KB)

Fix your caps lock key and next edit your post. Posting in all capitals is considered shouting.

Please provide a wiring diagram.

What kind of errors in your code; does it not compile?

Please read https://forum.arduino.cc/index.php?topic=148850.0 and pay special attention to point #7 about posting code; your code is small enough to insert in a post instead of attaching.

#include <ThingSpeak.h>               // add librery
#include <ESP8266WiFi.h>

WiFiClient  client;
unsigned long counterChannelNumber = 1027878;                // Channel ID
const char * myCounterReadAPIKey = "CXADD6SZ5W4RKRHD";
                                                      // Read API Key
const int FieldNumber1 = led1 ; 
const int FieldNumber2 = led2 ;
const int FieldNumber3 = led3 ;
                                     // The field you wish to read
uint8_t LEDpin = D6;
uint8_t LEDpin = D7;
uint8_t LEDpin = D8;

unsigned int presentValue = 0;
unsigned int changeValue = 0;

void setup()
{
  Serial.begin(115200);
  Serial.println();

  WiFi.begin("POCO PHONE", "9004652173");                 // write wifi name & password

  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
  ThingSpeak.begin(client);
}

void loop()
{
  int A = ThingSpeak.readLongField(counterChannelNumber, FieldNumber1, myCounterReadAPIKey);
  presentValue = A;
  if (presentValue != changeValue)
  {
    Serial.println(led1);
    analogWrite(LEDpin , A);
    changeValue = presentValue;
  }

  int B = ThingSpeak.readLongField(counterChannelNumber, FieldNumber3, myCounterReadAPIKey);
  presentValue = B
  if (presentValue != changeValue)
  {
    Serial.println(led2);
    analogWrite(LEDpin , B);
    changeValue = presentValue;
  }

  int C = ThingSpeak.readLongField(counterChannelNumber, FieldNumber3, myCounterReadAPIKey);
  presentValue = C;
  if (presentValue != changeValue)
  {
    Serial.println(led3);
    analogWrite(LEDpin , C);
    changeValue = presentValue;
  }
}

PS
I don’t have ESPs, so can’t compile / test

const int FieldNumber1 = led1 ; 
const int FieldNumber2 = led2 ;
const int FieldNumber3 = led3 ;

The compiler is complaining that it does not understand what you mean by led1, led2 or led3 as they have not been declared

uint8_t LEDpin = D6;
uint8_t LEDpin = D7;
uint8_t LEDpin = D8;

You can only have one variable named LEDpin

i cant compile the code thats the problem and after that there is no issue in the wiring thanks if know the solution then say , dont spam .

Please post the code (in code tags) and all the error messages.