Hi,
I’m new here and I couldn’t find the answer to my question - not because it wasn’t probably asked before, but because I have no idea what to search for… This should have a simple solution though.
I use the BLYNK_WRITE(V1) to define the brightness of my LED. I then want it to be delayed for some time afterwards. I want the delay to be set by a different widget, but I’m having trouble doing that.
Is there a way to pull the information of a virtual pin?
Also, my plan is to use two widgets to control a linear actuator. My goal is to set the velocity of its motion and the duration of each stroke using two widgets, but right now I’m unable to understand of to use the state of virtual pins in a more complex function. Is this possible?
Here is the code of the LED I’m trying to manipulate (with no luck):
BLYNK_WRITE(V1)
{
int brightness = param.asInt();
analogWrite(led, brightness);
delay(duration); // duration should be pulled from the 2nd widgets on V2
analogWrite(led, 0);
}
BLYNK_WRITE(V2)
{
int duration = param.asInt();
duration = 1000 * duration
}
Thanks in advance!