Control a step motor

at least I get the value from the slider V3 read by below function and the output is displayed at v17

@Spudgunmanhow can I see the output from :// BLYNK_LOG(“Got a value: %s”, param.asStr()); I am currently connected on USb serial with Arduino UNO

Now how do I get the timeled value accessible in the sktech outside of the BLYNK_Write(3) function?

BLYNK_WRITE(3)
{
  // BLYNK_LOG("Got a value: %s", param.asStr());
  // You can also use: asInt() and asDouble()
  int timeled = param.asInt();
  Blynk.virtualWrite(17, timeled);
}

http://www.arduino.cc/en/Reference/Scope

I don’t know about the Serial Debug I haven’t tried with out network stack yet. I saw your post here Serial Debug for Arduino UNO connected on USB what happens if you click monitor serial when this whole thing is running? will it monitor it or say device in use?

thanks for the link to Variable Scope

removing the definition of timeled as local variable should do the job

BLYNK_WRITE(3)
{
  // BLYNK_LOG("Got a value: %s", param.asStr());
  // You can also use: asInt() and asDouble()
  //int timeled = param.asInt();
  timeled = param.asInt();
  Blynk.virtualWrite(17, timeled);
}

This seems to work now :smile:

the varaible timeled can be changed from a slider on V3 pin; the V3 slider value is shown at V17; BLYNK_READ(5) reads the value on V5 (= uptime) but writes the timeled variable to V13

and in the main loop an if statement checks timeled and in case it is above 3000 it is set to 300.

So far so good: the only thing i wanted also to learn/achieve was to change the timer during a run by a slider
eg using timeled variable timer.setInterval(timeled/2,Blink_On)

#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11);
#define BLYNK_PRINT SwSerial
#include <BlynkSimpleSerial.h>
#include <SimpleTimer.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";

int timeled = 300;

SimpleTimer timer;

void setup()
{
  pinMode(13, OUTPUT);
  SwSerial.begin(9600);
  Blynk.begin(auth);
  timer.setInterval(1000, sendUptime);
  timer.setInterval(timeled/2,Blink_On);
  timer.setInterval(timeled,Blink_Off);  
}

void sendUptime()
{
  Blynk.virtualWrite(5, millis()/1000);
  Blynk.virtualWrite(6, millis()/100);
 }

void Blink_On()
{
 digitalWrite(13, HIGH);
 }

void Blink_Off()
{
digitalWrite(13, LOW);
}


BLYNK_READ(5)
{
  // This command writes Arduino's uptime in seconds to Virtual Pin (5)
  Blynk.virtualWrite(13, timeled);
}


BLYNK_WRITE(3)
{
  // BLYNK_LOG("Got a value: %s", param.asStr());
  // You can also use: asInt() and asDouble()
  timeled = param.asInt();
  Blynk.virtualWrite(17, timeled);
}



void loop()
{
  Blynk.run();
  timer.run(); // Initiates SimpleTimer
  if (timeled > 3000)
 {
  timeled = 300;// do something here
}
}