user59975: I'm trying to use the ESP32 board to control an LED, buzzer, and motor (ABA) through an access point.
I got some code from this page:
https://lastminuteengineers.com/creating-esp32-web-server-arduino-ide/
Which is amazing! I changed some names here and there and evrything okay (to control ONLY 2 things).
Now that I wanted to add the 3rd device, the code is not compiling.
I get this error:
exit status 1

too few arguments to function 'String SendHTML(uint8_t, uint8_t, uint8_t)'

With the line in bold marked.
server.send(200, "text/html", SendHTML(ABA1status,false)); 
#include <ETH.h>
#include <WiFi.h>
#include <WiFiAP.h>
#include <WiFiClient.h>
#include <WiFiGeneric.h>
#include <WiFiMulti.h>
#include <WiFiScan.h>
#include <WiFiServer.h>
#include <WiFiSTA.h>
#include <WiFiType.h>
#include <WiFiUdp.h>

#include <HTTP_Method.h>
#include <WebServer.h>




/* Put your SSID & Password */
const char* ssid = "ESP32DeltaSolutions";  // Enter SSID here
const char* password = "deltasolutions123";  //Enter Password here

/* Put IP Address details */
IPAddress local_ip(192,168,1,2);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);

WebServer server(80);

uint8_t LED1pin = 25;
bool LED1status = LOW;

uint8_t BUZZ1pin = 32;
bool BUZZ1status = LOW;

uint8_t ABA1pin = 35;
bool ABA1status = LOW;



void setup() {
  Serial.begin(115200);
  pinMode(LED1pin, OUTPUT);
  pinMode(BUZZ1pin, OUTPUT);
  pinMode(ABA1pin, OUTPUT);

  WiFi.softAP(ssid, password);
  WiFi.softAPConfig(local_ip, gateway, subnet);
  delay(100);

  server.on("/", handle_OnConnect);
  server.on("/led1on", handle_led1on);
  server.on("/led1off", handle_led1off);
  server.on("/buzz1on", handle_buzz1on);
  server.on("/buzz1off", handle_buzz1off);
  server.on("/aba1on", handle_aba1on);
  server.on("/aba1off", handle_aba1off);
  server.onNotFound(handle_NotFound);

  server.begin();
  Serial.println("HTTP server started");
}
void loop() {
  server.handleClient();
  if(LED1status)
  {digitalWrite(LED1pin, HIGH);}
  else
  {digitalWrite(LED1pin, LOW);}

  if(BUZZ1status)
  {digitalWrite(BUZZ1pin, HIGH);}
  else
  {digitalWrite(BUZZ1pin, LOW);}

  if(ABA1status)
  {digitalWrite(ABA1pin, HIGH);}
  else
  {digitalWrite(ABA1pin, LOW);}

}

void handle_OnConnect() {
  LED1status = LOW;
  BUZZ1status = LOW;
  ABA1status = LOW;
  Serial.println("GPIO4 Status: OFF | GPIO5 Status: OFF");
  server.send(200, "text/html", SendHTML(LED1status,BUZZ1status,ABA1status)); 
}

void handle_led1on() {
  LED1status = HIGH;
  Serial.println("GPIO4 Status: ON");
  server.send(200, "text/html", SendHTML(true,LED1status)); 
}

void handle_led1off() {
  LED1status = LOW;
  Serial.println("GPIO4 Status: OFF");
  server.send(200, "text/html", SendHTML(false,LED1status)); 
}

void handle_buzz1on() {
  BUZZ1status = HIGH;
  Serial.println("GPIO5 Status: ON");
  server.send(200, "text/html", SendHTML(BUZZ1status,true)); 
}

void handle_buzz1off() {
  BUZZ1status = LOW;
  Serial.println("GPIO5 Status: OFF");
  server.send(200, "text/html", SendHTML(BUZZ1status,false)); 
}

void handle_aba1on() {
  ABA1status = HIGH;
  Serial.println("GPI35 Status: ON");
  server.send(200, "text/html", SendHTML(ABA1status,true)); 
}

void handle_aba1off() {
  BUZZ1status = LOW;
  Serial.println("GPI35 Status: OFF");
  **server.send(200, "text/html", SendHTML(ABA1status,false));** 
}

void handle_NotFound(){
  server.send(404, "text/plain", "Not found");
}

String SendHTML(uint8_t LED1status,uint8_t BUZZ1status,uint8_t ABA1status){
  String ptr = "<!DOCTYPE html> <html>\n";
  ptr +="<head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\">\n";
  ptr +="<title>LED Control</title>\n";
  ptr +="<style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}\n";
  ptr +="body{margin-top: 50px;} h1 {color: #444444;margin: 50px auto 30px;} h3 {color: #444444;margin-bottom: 50px;}\n";
  ptr +=".button {display: block;width: 80px;background-color: #3498db;border: none;color: white;padding: 13px 30px;text-decoration: none;font-size: 25px;margin: 0px auto 35px;cursor: pointer;border-radius: 4px;}\n";
  ptr +=".button-on {background-color: #3498db;}\n";
  ptr +=".button-on:active {background-color: #2980b9;}\n";
  ptr +=".button-off {background-color: #34495e;}\n";
  ptr +=".button-off:active {background-color: #2c3e50;}\n";
  ptr +="p {font-size: 14px;color: #888;margin-bottom: 10px;}\n";
  ptr +="</style>\n";
  ptr +="</head>\n";
  ptr +="<body>\n";
  ptr +="<h1>ESP32 Web Server</h1>\n";
  ptr +="<h3>Using Access Point(AP) Mode</h3>\n";
  ptr +="<h3>Delta solutions</h3>\n";

   if(led1stat)
  {ptr +="<p>LED1 Status: ON</p><a class=\"button button-off\" href=\"/led1off\">OFF</a>\n";}
  else
  {ptr +="<p>LED1 Status: OFF</p><a class=\"button button-on\" href=\"/led1on\">ON</a>\n";}

  if(buzz1stat)
  {ptr +="<p>BUZZ1 Status: ON</p><a class=\"button button-off\" href=\"/buzz1off\">OFF</a>\n";}
  else
  {ptr +="<p>BUZZ1 Status: OFF</p><a class=\"button button-on\" href=\"/buzz1on\">ON</a>\n";}

  if(aba1stat)
  {ptr +="<p>ABA1 Status: ON</p><a class=\"button button-off\" href=\"/aba1off\">OFF</a>\n";}
  else
  {ptr +="<p>ABA1 Status: OFF</p><a class=\"button button-on\" href=\"/aba1on\">ON</a>\n";}

  ptr +="</body>\n";
  ptr +="</html>\n";
  return ptr;

Any suggestions?
Thanks!

user59044: The syntax of six SendHTML you use with true and false is actually wrong.
By defining a function like this String SendHTML(uint8_t LED1status,uint8_t BUZZ1status,uint8_t ABA1status), you mean that first, second and third input to this function are Status of LED1, Status of BUZZ1 and Status of ABA1.
So try replacing all six SendHTML with true and false functions to this SendHTML(LED1status,BUZZ1status,ABA1status)

59975: <p>I'm trying to use the ESP32 board to control an LED, buzzer, and motor (ABA) through an access point.</p>

<p>I got some code from this page:
<a href="https://lastminuteengineers.com/creating-esp32-web-server-arduino-ide/" rel="nofollow noreferrer">https://lastminuteengineers.com/creating-esp32-web-server-arduino-ide/</a>
Which is amazing! I changed some names here and there and evrything okay (to control ONLY 2 things).</p>

<p>Now that I wanted to add the 3rd device, the code is not compiling.</p>

<p>I get this error:</p>

<pre><code>exit status 1

too few arguments to function 'String SendHTML(uint8_t, uint8_t, uint8_t)'
</code></pre>

<p>With the line in bold marked.</p>

<p><strong>server.send(200, "text/html", SendHTML(ABA1status,false));</strong> </p>

<pre><code>#include &lt;ETH.h&gt;
#include &lt;WiFi.h&gt;
#include &lt;WiFiAP.h&gt;
#include &lt;WiFiClient.h&gt;
#include &lt;WiFiGeneric.h&gt;
#include &lt;WiFiMulti.h&gt;
#include &lt;WiFiScan.h&gt;
#include &lt;WiFiServer.h&gt;
#include &lt;WiFiSTA.h&gt;
#include &lt;WiFiType.h&gt;
#include &lt;WiFiUdp.h&gt;

#include &lt;HTTP_Method.h&gt;
#include &lt;WebServer.h&gt;




/* Put your SSID &amp; Password */
const char* ssid = "ESP32DeltaSolutions";  // Enter SSID here
const char* password = "deltasolutions123";  //Enter Password here

/* Put IP Address details */
IPAddress local_ip(192,168,1,2);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);

WebServer server(80);

uint8_t LED1pin = 25;
bool LED1status = LOW;

uint8_t BUZZ1pin = 32;
bool BUZZ1status = LOW;

uint8_t ABA1pin = 35;
bool ABA1status = LOW;



void setup() {
  Serial.begin(115200);
  pinMode(LED1pin, OUTPUT);
  pinMode(BUZZ1pin, OUTPUT);
  pinMode(ABA1pin, OUTPUT);

  WiFi.softAP(ssid, password);
  WiFi.softAPConfig(local_ip, gateway, subnet);
  delay(100);

  server.on("/", handle_OnConnect);
  server.on("/led1on", handle_led1on);
  server.on("/led1off", handle_led1off);
  server.on("/buzz1on", handle_buzz1on);
  server.on("/buzz1off", handle_buzz1off);
  server.on("/aba1on", handle_aba1on);
  server.on("/aba1off", handle_aba1off);
  server.onNotFound(handle_NotFound);

  server.begin();
  Serial.println("HTTP server started");
}
void loop() {
  server.handleClient();
  if(LED1status)
  {digitalWrite(LED1pin, HIGH);}
  else
  {digitalWrite(LED1pin, LOW);}

  if(BUZZ1status)
  {digitalWrite(BUZZ1pin, HIGH);}
  else
  {digitalWrite(BUZZ1pin, LOW);}

  if(ABA1status)
  {digitalWrite(ABA1pin, HIGH);}
  else
  {digitalWrite(ABA1pin, LOW);}

}

void handle_OnConnect() {
  LED1status = LOW;
  BUZZ1status = LOW;
  ABA1status = LOW;
  Serial.println("GPIO4 Status: OFF | GPIO5 Status: OFF");
  server.send(200, "text/html", SendHTML(LED1status,BUZZ1status,ABA1status)); 
}

void handle_led1on() {
  LED1status = HIGH;
  Serial.println("GPIO4 Status: ON");
  server.send(200, "text/html", SendHTML(true,LED1status)); 
}

void handle_led1off() {
  LED1status = LOW;
  Serial.println("GPIO4 Status: OFF");
  server.send(200, "text/html", SendHTML(false,LED1status)); 
}

void handle_buzz1on() {
  BUZZ1status = HIGH;
  Serial.println("GPIO5 Status: ON");
  server.send(200, "text/html", SendHTML(BUZZ1status,true)); 
}

void handle_buzz1off() {
  BUZZ1status = LOW;
  Serial.println("GPIO5 Status: OFF");
  server.send(200, "text/html", SendHTML(BUZZ1status,false)); 
}

void handle_aba1on() {
  ABA1status = HIGH;
  Serial.println("GPI35 Status: ON");
  server.send(200, "text/html", SendHTML(ABA1status,true)); 
}

void handle_aba1off() {
  BUZZ1status = LOW;
  Serial.println("GPI35 Status: OFF");
  **server.send(200, "text/html", SendHTML(ABA1status,false));** 
}

void handle_NotFound(){
  server.send(404, "text/plain", "Not found");
}

String SendHTML(uint8_t LED1status,uint8_t BUZZ1status,uint8_t ABA1status){
  String ptr = "&lt;!DOCTYPE html&gt; &lt;html&gt;\n";
  ptr +="&lt;head&gt;&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\"&gt;\n";
  ptr +="&lt;title&gt;LED Control&lt;/title&gt;\n";
  ptr +="&lt;style&gt;html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}\n";
  ptr +="body{margin-top: 50px;} h1 {color: #444444;margin: 50px auto 30px;} h3 {color: #444444;margin-bottom: 50px;}\n";
  ptr +=".button {display: block;width: 80px;background-color: #3498db;border: none;color: white;padding: 13px 30px;text-decoration: none;font-size: 25px;margin: 0px auto 35px;cursor: pointer;border-radius: 4px;}\n";
  ptr +=".button-on {background-color: #3498db;}\n";
  ptr +=".button-on:active {background-color: #2980b9;}\n";
  ptr +=".button-off {background-color: #34495e;}\n";
  ptr +=".button-off:active {background-color: #2c3e50;}\n";
  ptr +="p {font-size: 14px;color: #888;margin-bottom: 10px;}\n";
  ptr +="&lt;/style&gt;\n";
  ptr +="&lt;/head&gt;\n";
  ptr +="&lt;body&gt;\n";
  ptr +="&lt;h1&gt;ESP32 Web Server&lt;/h1&gt;\n";
  ptr +="&lt;h3&gt;Using Access Point(AP) Mode&lt;/h3&gt;\n";
  ptr +="&lt;h3&gt;Delta solutions&lt;/h3&gt;\n";

   if(led1stat)
  {ptr +="&lt;p&gt;LED1 Status: ON&lt;/p&gt;&lt;a class=\"button button-off\" href=\"/led1off\"&gt;OFF&lt;/a&gt;\n";}
  else
  {ptr +="&lt;p&gt;LED1 Status: OFF&lt;/p&gt;&lt;a class=\"button button-on\" href=\"/led1on\"&gt;ON&lt;/a&gt;\n";}

  if(buzz1stat)
  {ptr +="&lt;p&gt;BUZZ1 Status: ON&lt;/p&gt;&lt;a class=\"button button-off\" href=\"/buzz1off\"&gt;OFF&lt;/a&gt;\n";}
  else
  {ptr +="&lt;p&gt;BUZZ1 Status: OFF&lt;/p&gt;&lt;a class=\"button button-on\" href=\"/buzz1on\"&gt;ON&lt;/a&gt;\n";}

  if(aba1stat)
  {ptr +="&lt;p&gt;ABA1 Status: ON&lt;/p&gt;&lt;a class=\"button button-off\" href=\"/aba1off\"&gt;OFF&lt;/a&gt;\n";}
  else
  {ptr +="&lt;p&gt;ABA1 Status: OFF&lt;/p&gt;&lt;a class=\"button button-on\" href=\"/aba1on\"&gt;ON&lt;/a&gt;\n";}

  ptr +="&lt;/body&gt;\n";
  ptr +="&lt;/html&gt;\n";
  return ptr;
</code></pre>

<p>Any suggestions?</p>

<p>Thanks!</p>
 59044: <p>The syntax of six <code>SendHTML</code> you use with <code>true</code> and <code>false</code> is actually wrong.</p>

<p>By defining a function like this <code>String SendHTML(uint8_t LED1status,uint8_t BUZZ1status,uint8_t ABA1status)</code>, you mean that first, second and third input to this function are Status of LED1, Status of BUZZ1 and Status of ABA1.</p>

<p>So try replacing all six <code>SendHTML</code> with <code>true</code> and <code>false</code> functions to this <code>SendHTML(LED1status,BUZZ1status,ABA1status)</code></p>
