Help with slider and step motor

Hello! I’m working on a project where i need to control a step motor.
This is the code so far:

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <StepperMotor.h>

StepperMotor motor(8,9,10,11);


// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

void setup()
{
  Serial.begin(9600);
  motor.setStepDuration(1);
  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();
}

The way this step motor is controlled is through this function/command thingy:

motor.step(1000);
motor.step(-1000);

The first one is forward and the second line is backwards.
My question is where do i put them so i can control them with a slider os something similar from the app?

You will need to assign slider to the virtual pin and control motor from within BLYNK_WRITE() function. More on Virtual pins:
http://docs.blynk.cc/#blynk-main-operations-virtual-pins

To get sketch example go to http://examples.blynk.cc/ and select “GettingStarted/GetData” example

Thank you this helps and i think this might work out perfectly!

Great! I know this is old but… Do you still have the code around? I am thinking about my application here and would be interested in seeing how your code turned out and what you are using it for.

Cheers

And yet you still resurrected it to ask for code :stuck_out_tongue: Assuming this OP is still around, they can PM you if need be.

Here is one way of doing it

https://community.blynk.cc/t/turning-old-arduinos-into-perfectly-usable-iot-devices/23456/2