Hi, Blynk support
I am using iPhone 11 with IOS version 13.5. I have made an app to control led connected to nRF52840 Arduino via BLE connection. I am using the blynk step widget to control LED. The step widget seems to have few issues
- when I stop the app and play again the step widget resets to 0 or -1.
- I have configured widget to increment 1 step but the widget sends value as 255 for an increment and 1 for decrement.
I am attaching the code snippet I used to read the step widget and workaround for the problem statement 2 but I am not able to tackle problem statement 1.
// To read a virtual pin in Blynk app:
BLYNK_WRITE(V7)
{
// V7 is sine wave cycles
V7_value = param.asInt();
if ((V7_value == 1) && (sine_cycles < 10))
{
sine_cycles++;
}
else if ((V7_value == 255) && (sine_cycles > 1))
{
sine_cycles--;
}
//used for testing purpose
#ifdef DEBUG
Serial.println("V7");
Serial.println(sine_cycles);
#endif
}
Please help me to resolve this issue.
Best regards,
Jesse