Project is not uploading

hey guys i am a robotic basic starter i know alot about ardiuno but i just started esp so iw as making this project the main

idea is You are building a smart RGB light system using an ESP32 that:

  • Connects to Wi-Fi (internet)
  • Hosts its own website
  • Lets a user control an RGB LED from a web page
  • Uses 4 main buttons (colors)
  • Also supports color combinations (mixing colors)
  • Can be controlled from any phone, tablet, or computer on the network

so i have the code

#include <WiFi.h>
#include <WebServer.h>

const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";

WebServer server(80);

// RGB pins
#define RED_PIN   25
#define GREEN_PIN 26
#define BLUE_PIN  27

// HTML page
String webpage = R"rawliteral(
<!DOCTYPE html>
<html>
<head>
  <title>ESP32 RGB Control</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    body { font-family: Arial; text-align: center; background:#111; color:white; }
    button {
      padding: 20px;
      margin: 10px;
      font-size: 18px;
      width: 140px;
      border: none;
      border-radius: 10px;
      color: white;
    }
    .red { background: red; }
    .green { background: green; }
    .blue { background: blue; }
    .white { background: gray; }
    .purple { background: purple; }
    .cyan { background: teal; }
    .yellow { background: orange; }
    .off { background: black; border: 1px solid white; }
  </style>
</head>
<body>
  <h1>ESP32 RGB Controller</h1>

  <button class="red" onclick="fetch('/red')">Red</button>
  <button class="green" onclick="fetch('/green')">Green</button>
  <button class="blue" onclick="fetch('/blue')">Blue</button>
  <button class="white" onclick="fetch('/white')">All</button><br>

  <button class="purple" onclick="fetch('/purple')">Purple</button>
  <button class="cyan" onclick="fetch('/cyan')">Cyan</button>
  <button class="yellow" onclick="fetch('/yellow')">Yellow</button><br>

  <button class="off" onclick="fetch('/off')">OFF</button>
</body>
</html>
)rawliteral";

void setColor(bool r, bool g, bool b) {
  digitalWrite(RED_PIN, r);
  digitalWrite(GREEN_PIN, g);
  digitalWrite(BLUE_PIN, b);
}

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

  pinMode(RED_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(BLUE_PIN, OUTPUT);

  setColor(0,0,0);

  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi");

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("\nConnected!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP());

  server.on("/", []() { server.send(200, "text/html", webpage); });

  server.on("/red", []()    { setColor(1,0,0); server.send(200); });
  server.on("/green", []()  { setColor(0,1,0); server.send(200); });
  server.on("/blue", []()   { setColor(0,0,1); server.send(200); });
  server.on("/white", []()  { setColor(1,1,1); server.send(200); });

  server.on("/purple", []() { setColor(1,0,1); server.send(200); });
  server.on("/cyan", []()   { setColor(0,1,1); server.send(200); });
  server.on("/yellow", []() { setColor(1,1,0); server.send(200); });

  server.on("/off", []()    { setColor(0,0,0); server.send(200); });

  server.begin();
}

void loop() {
  server.handleClient();
}

but its not uploading i tried every thing

Hi @terarizor456

Please post the full and exact text of the error message that you see when this happens in a reply here on this forum topic.

Check your ESP board's need to (1) press the BOOT button before loading a sketch, or (2) hold-boot-press-reset-release-both. Also, verify your USB cable is for DATA.