'float' is ambiguous

Hi there. below are my code for my nodemcu. somehow when compiling it returns "conversion from BlynkTimer:Handle 'float' is ambigous" something like that. But when i tried to compile it with my friends pc somehow it succesfully compiled. what seems to be the problem? is it my libraries?

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SoftwareSerial.h>
//#include <SimpleTimer.h>
//#include <Timer.h> //'timer' does not name a type
//#define Timer t
#define SimpleTimer_H
char auth[] = "ieMqDiAtG4zFVe3xoPP4g2zIb0xasdasdasdJ";
 
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "asdasdasd"; 
char pass[] = "qawasdasd";
BlynkTimer t;
float Timer1 = 0;


String myString; // complete message from arduino, which consistors of snesors data
char cdata; // received charactors
float FLOW; // sensors 
// This function sends Arduino's up time every second to Virtual Pin (1).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V0, millis() / 1000);
  
}
 
 
 
void setup()
{
//Timer= timer;
  // Debug console
  Serial.begin(9600);
 
  Blynk.begin(auth, ssid, pass);

    Timer1 = t.setInterval(1000L,flow); 
   

}
void loop() /////////////////////////////////////////////////////////////
{
  //Timer = timer;
   if (Serial.available() == 0 ) 
   {
  Blynk.run();
  t.run(); // Initiates BlynkTimer
   }
   
  if (Serial.available() > 0 ) 
  {
    cdata = Serial.read(); 
    myString = myString+ cdata; 
   // Serial.print(rdata);
    if( cdata == '\n')
    {
   //  Serial.println(myString); 
  // Serial.println("fahad");
// new code
String l = getValue(myString, ',', 0);
 
 
FLOW = l.toFloat();
 
  myString = "";
// end new code
    }
  }
 
}
 
void flow()
{
float sdata1 = FLOW;
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V0, sdata1);
 
}

String getValue(String cdata, char separator, int index)
{
    int found = 0;
    int strIndex[] = { 0, -1 };
    int maxIndex = cdata.length() - 1;
 
    for (int i = 0; i <= maxIndex && found <= index; i++) {
        if (cdata.charAt(i) == separator || i == maxIndex) {
            found++;
            strIndex[0] = strIndex[1] + 1;
            strIndex[1] = (i == maxIndex) ? i+1 : i;
        }
    }
    return found > index ? cdata.substring(strIndex[0], strIndex[1]) : "";
}

Don't bother to tell us the exact error message or where it occurred.

We love to work out puzzles for strangers

sorry as i said im new to this forum and arduino. heres the error line.
Timer1 = t.setInterval(1000L,flow);
it return; conversion from 'BlynkTimer::Handle' to 'float' is ambiguous

I'm just curious, why do you store the returned value of t.setInterval() in a float variable.

Timer1 = t.setInterval(1000L,flow);

What is the purpose? Do the setInterval function return a float?

I couldnt find that specific function the the blynk documentation. What library version do you use?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.