Invalid use of void expression

I get this error code invalid use of void expressions on line 18, any solution?

Please edit your post to include the code and complete error message as text, using code tags. Forum members do not appreciate screen shots.

For more suggestions on how to get help, please read the "How to get the best out of this forum" post.

#include <ESP8266WiFi.h>
#include<Ticker.h>
#define LedWifi D4
String ssid = "Cristian";
String password = "Cristian";
Ticker Tic_WifiLed;
byte cont = 0;
byte max_intentos = 50;
void ParpadeoLedWifi ( ) {
byte estado = digitalRead(LedWifi);
digitalWrite(LedWifi, !estado);
}
void setup( ) {
//Inicia serial
pinMode(LedWifi, OUTPUT);
Serial.begin(115200);
Serial.println("\n");
Tic_WifiLed(0.2, ParpadeoLedWifi( ));
//Conexión WIFI
WiFi.begin(ssid, password);
while (WiFi.status( ) !WL_CONNECTED and cont < max_intentos) {
//Cuenta hasta 50
cont++;
delay(500);
Serial.print(".");
}
Serial.println(" ");
if ( cont < max_intentos) { //Si se conectó
Serial.println(
}"");
Serial.print("Conectado a la red WiFi: ");
Serial.println(WiFi.SSID( ));
Serial.print( "IP: " );
Serial.println(WiFi.localIP( ));
Serial.print("macAddress: ");
Serial.println(WiFi.macAddress( ));
Serial.println("
*");
}
Else{ //No se conectó
Serial.println("-----------------------");
Serial.println("Error de conexión");
Serial.println("-----------------------");
}
tic_WifiLed.detach();
digitalWrite(ledWifi, HIGH);
}
Void loop( ) {
}

Add the code tags, please. "< code >" editor button.

On line 18 there is the error of invalid use of void expression

Try again, CODE TAGS:

Tic_WifiLed function expects 2 arguments. ParpadeoLedWifi( ) is invoked, expecting it to return a value, but it is defined as void.

by any chance does Tic_WifiLed expect a function pointer as a 2nd argument?

or are these parameters suppose to be specified when Tic WiFiLed is declared?

Shouldn't it be

Tic_WifiLed.attach(0.2, ParpadeoLedWifi);

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