Error: void not ignored as it out to be 4 pin Fan Control

Hi I'm having trouble understanding what I have to fix, I copy and pasted this code from google generative AI:

#define BLYNK_TEMPLATE_ID "TMPL2Ed3ccUoU"
#define BLYNK_TEMPLATE_NAME "speed"
#define BLYNK_AUTH_TOKEN "meijtQ53G7hu0uHal-ag3mlQP01_bsI4"
#include <Wire.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Blynk.h>


char ssid[] = "";
char password[] = "";
char auth[] = "YOUR_BLYNK_AUTH_TOKEN";


const int fanPin = 15; 


void setup() {
 Serial.begin(115200);
Blynk.begin(auth, ssid, password);
pinMode(fanPin, OUTPUT); 
}
void loop() {
Blynk.run(); 



        // Read the slider value from Blynk and set the PWM duty cycle
int sliderValue = Blynk.virtualWrite(V0); // Replace V0 with your slider widget virtual pin
analogWrite(fanPin, sliderValue); 
}

and I get this error:

4812-33748-12nfo33.785o\sketch_sep12b\sketch_sep12b.ino:30:37: error: void value not ignored as it ought to be
   30 | int sliderValue = Blynk.virtualWrite(V0); // Replace V0 with your slider widget virtual pin

can someone help me please?

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