no matching function for call to 'String(String (&)())'

#include <SoftwareSerial.h>
#include <dht11.h>
#include <ACS712.h>
#define RX 2
#define TX 3
#define dht_apin A0 // Analog Pin sensor is connected to
dht11 dhtObject;
String AP = "Redmi";       // AP NAME
String PASS = "Sunny898"; // AP PASSWORD
String API = "ABY09QBF56MZ59QL";   // Write API KEY
String HOST = "api.thingspeak.com";
String PORT = "80";
int countTrueCommand;
int countTimeCommand;
boolean found = false;
int valSensor = 1;
ACS712 sensor(ACS712_30A, A1);
SoftwareSerial esp8266(RX, TX);


void setup()
{
  Serial.begin(9600);
  esp8266.begin(115200);
  sendCommand("AT", 5, "OK");
  sendCommand("AT+RESTORE", 5, "OK");
  sendCommand("AT+CWMODE=1", 5, "OK");
  sendCommand("AT+CWJAP=\"" + AP + "\",\"" + PASS + "\"", 20, "OK");
  sensor.calibrate();
}
void loop()
{
  String getData = "GET /update?api_key=" + API + "&field1=" + getTemperatureValue() + "&field2=" + getHumidityValue() + "&field3=" + getCurrentAC();
  sendCommand("AT+CIPMUX=1", 5, "OK");
  sendCommand("AT+CIPSTART=0,\"TCP\",\"" + HOST + "\"," + PORT, 15, "OK");
  sendCommand("AT+CIPSEND=0," + String(getData.length() + 4), 4, ">");
  esp8266.println(getData); delay(1500); countTrueCommand++;
  sendCommand("AT+CIPCLOSE=0", 5, "OK");
}
String getTemperatureValue()
{
  dhtObject.read(dht_apin);
  Serial.print(" Temperature(C)= ");
  int temp = dhtObject.temperature;
  Serial.println(temp);
  delay(50);
  return String(temp);

}
String getHumidityValue()
{

  dhtObject.read(dht_apin);
  Serial.print(" Humidity in %= ");
  int humidity = dhtObject.humidity;
  Serial.println(humidity);
  delay(50);
  return String(humidity);
}
String getCurrentAC()
{
  float I = sensor.getCurrentAC();
  Serial.print("I = ");
  Serial.print(I);
  delay(50);
  return String(getCurrentAC);//Errror in this line 
}
void sendCommand(String command, int maxTime, char readReplay[])
{
  Serial.print(countTrueCommand);
  Serial.print(". at command => ");
  Serial.print(command);
  Serial.print(" ");
  while (countTimeCommand < (maxTime * 1))
  {
    esp8266.println(command);//at+cipsend
    if (esp8266.find(readReplay)) //ok
    {
      found = true;
      break;
    }

    countTimeCommand++;
  }
  if (found == true)
  {
    Serial.println("Ok");
    countTrueCommand++;
    countTimeCommand = 0;
  }
  if (found == false)
  {
    Serial.println("Fail");
    countTrueCommand = 0;
    countTimeCommand = 0;
  }
  found = false;
}

How yo fix this???

(deleted)

return String(getCurrentAC);

What do you think the value of getCurrentAC is at that point ?

Why not simply return Current ?

As to this

 Serial.print(String("I = ") +Current );

Can you concatenate a String with a float even if the brackets were in the right place ?

acs712 library is used and then this is function of library will

?

I have Uploded the Whole code Check And Find Some Solution please

UKHeliBob:
?

See the whole code and find some solution please

return String(getCurrentAC); How do you expect to make a String out of a function pointer?

Did you mean to return “I”?
If so, why not simply return it as a float?

(deleted)

spycatcher2k:
Hi SunnyGaikwad you changed your original post, making everyone who answered your original question look like an idiot.

Due to this, I will no longer be giving you any support.

Good bye.

sorry for that but i have uplod whole code for better understanding

if (found == true)
  {
    Serial.println("Ok");
    countTrueCommand++;
    countTimeCommand = 0;
  }
  if (found == false)

Don’t you trust “else”?

Report to Moderator is for "ACTUAL" reports not random letters.

Bob.

(deleted)