BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

ESP8266 - Control speed with slider

Hello everyone!

I need help with my project, I can’t find a solution.

The concept is simple: I have an ESP8266 and I have to drive a 5V powered fan using an L9110. I would like to use a slider to change the speed and a button to turn on and off. All this with the virtual.

Can anyone write me a sketch to use?

I started recently, on the internet I found unclear solutions.

Thank you all!

This sketch builder example will allow you to get the slider value into your device:
https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=GettingStarted%2FVirtualPinRead

Where the sketch says:

  // process received value

is the place where you will need to put the code to control your fan, presumably using a digitalWrite command.
You will probably have to declare the pin that your fan controller is attached to as an output pin using a pinMode(OUTPUT) command in your void setup.

Pete.

Thanks a lot for your answer!
Can you write me the example with the code to control the fan please? (digitalWrite and pinMode)
For me Blynk is a new world and I would like learn with this complete example.
Sorry for disturbing!

I made the program with digitalWrite then controlling outputs D5 and D6. Many programs use V1 or V2 I wanted to understand the difference and how they fit.
thank you!

If you want to understand the difference between digital and virtual pins then I’d suggest that you read this:

This forum isn’t a C++ code factory. The coding concepts I’ve mentioned azrnet unique to Blynk, so I suggest that you do some online learn about C++/Arduino coding techniques. There are many many YouTube videos on the subject, and if Youtube dienst suit your learning style then there are many other formats of tutorial available too.

The time you invest in learning at this stage will pay dividends in future projects.

Pete.