Blynk Function Not Working

The param.asInt on V9 is a numeric input widget with a time of 0 - 120min. The idea is to get the info and turn it into millis to be used elsewhere. On the serial monitor it shows a 0 value although on the app the widget has been set to 2min. Can someone please explain why is that?

BLYNK_WRITE(V9)   //CH1 FADEIN TIME WIDGET
{
  FadeIN = param.asInt();
  FadeInTime == (FadeIN * 60000);   //Param is in minutes
  //FadeInTime = map(FadeIN, 0, 120, 0, 7200000);    //2 hour max fade duration
  Serial.print("LedFadeIn Time: ");
  Serial.println(FadeInTime);
}

Is fadeInTime an int? If so try making it a long.

Failing that post all your code using 3 backtsticks at per forum rules and we can have a look.

But I think the problem is the variable isn’t big enough to hold your number.

Integers are sufficient for your ranges.

But you are using the Comparison Operator == when you should be using the Arithmetic Operator (Equal/Assignment operator) =

1 Like

Ah yes, cheers @Gunner, I was thinking of IEC61131 (PLC) for a moment there where ints are ffectively shorts in C++

@Gunner thanks that worked.

1 Like