I need to create two buttons onto my webPage, (im using ESP32C3), to calibrate my scale without a phisical button

Il drop my code here for anyone who has any idea on how can i code two buttons into my webPage, but please dont change any of the code just show me how to create and how to use it and how t o gatter the input received from him (parts of the code are poorly documented, and most of the variables are not actually being used as i forgot to delet them).

#include <WiFi.h>
#include <HX711.h>
#define DOUT 2  // Data do HX711
#define CLK 5   // Clock do HX711
#define butto 0
const char* ssid = "ESP32-Access-Point";
const char* password = "123456789";
HX711 balanca;
float peso, raw;
float fator_calibracao = 1100.0;
WiFiServer server(80);
float rawCalibrado = 0;
int buttonState = 0, x = 0;  // variable for reading the pushbutton status
float minRaw, maxRaw, midRaw = 0;
uint32_t weight;
bool buclemyshoe = false;

void setup() {
  Serial.begin(115200);
  pinMode(butto, INPUT);
  Serial.print("Setting AP (Access Point)…");
  WiFi.softAP(ssid, password);
  IPAddress IP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(IP);
  delay(500);
  Serial.println("Inicializando balança...");
  balanca.begin(DOUT, CLK);
  balanca.set_scale(fator_calibracao);
  balanca.tare();
  Serial.println("Balança pronta para pesar.");
  server.begin();
}

void loop() {
  buttonState = digitalRead(butto);
  peso = balanca.get_units(5);
  raw = balanca.read();
  rawCalibrado = ((raw - minRaw) * weight) / midRaw;  
  WiFiClient client = server.available();
  if (client) {
    Serial.println("New Client.");
    String currentLine = "";
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        currentLine += c;
        if (c == '\n') {
          if (currentLine.length() == 2) {
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println("Connection: close");
            client.println();
            client.println("<html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><meta http-equiv='refresh' content='1'></head>");
            client.println("<body><h1>Peso Atual</h1><br>");
            client.println("<br>Peso: " + String(peso) + "</body></html>");
            client.println("<br>Peso: " + String(raw) + "</body></html>");
            client.println("<br>Peso: " + String(rawCalibrado) + "</body></html>");
            client.println("<p>Durante a calibração utilize o serial monitor</p>");
            if (buttonState == LOW)
            {
              rawcalibr();
              client.println();
              break;
            }
            else {
              client.println();
              break;
            }
          } else {
            currentLine = "";
          }
        } else if (c != '\r') {
          currentLine += c;
        }
      }
    }
    client.stop();
    Serial.println("Client disconnected.");
    Serial.println("");
  }
}

void rawcalibr()
{
  Serial.println("\n\nCALIBRATION\n===========");
  Serial.println("remove all weight from the loadcell");
  //  flush Serial input
  while (Serial.available()) Serial.read();

  Serial.println("and press enter\n");
  while (Serial.available() == 0);

  Serial.println("Determine zero weight offset");

  //minRaw = 0;
  //x = 0;
  //for (int i = 0; i < 10; i++)
  //{
  //  x = balanca.read();
  //  minRaw = minRaw + x;
  //}
  //minRaw = minRaw/10;
  minRaw = balanca.read();

  Serial.print("Minium Raw Value: ");
  Serial.println(minRaw);
  Serial.println();

  Serial.println("place a weight on the loadcell");
  //  flush Serial input
  while (Serial.available()) Serial.read();

  Serial.println("enter the weight in (whole) grams and press enter");
  weight = 0;
  while (Serial.peek() != '\n')
  {
    if (Serial.available())
    {
      char ch = Serial.read();
      if (isdigit(ch))
      {
        weight *= 10;
        weight = weight + (ch - '0');
      }
    }
  }

  Serial.print("Current Weight: ");
  Serial.println(weight);

  //maxRaw = 0;
  //x = 0;
  //for (int i = 0; i < 10; i++)
  //{
  //  x = balanca.read();
  //  maxRaw = maxRaw + x;
  //}
  //maxRaw = maxRaw/10;
  maxRaw = balanca.read();
  midRaw = maxRaw-minRaw;
  Serial.println(weight);
  Serial.println(minRaw);
  Serial.println(maxRaw);
}

I moved your topic to an appropriate forum category @nienx3.

In the future, when creating a topic please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

How did you decide this is the code you want? If you want to keep this sketch, you should remove the parts you do not need.

Describe your idea in full.

To write your own; start with a minimal program, then add functions you need, one at a time.

I know, but right now ive tried a lot of ways to add buttons but they all seem to not work properly, and even though i need to eleminate the parts i dont need i keep them to remember myself of the logic i will have to add in the web buttons for them to properly calibrate the scale

Not true. You must verify your work. Search on "arduino button input_pullup" The following method of wiring a button to read HIGH with NOT PRESSED and LOW when PRESSED is very simple, with the least material. Verify your work.

https://docs.arduino.cc/tutorials/generic/digital-input-pullup/

You can keep anything you want in your code, but if you are asking for help, you should present code with that shows your issue, without extra lines of code to look through.