Digital pin widget

It works with iOS.

yes and it works well with android now !
thank you so much !
tomorow I will use 128 pins more :smile:
maybe we need 512 ? :thinking:

1 Like

It just wonā€™t work in the other direction. For example, you can assign a Text Input widget to V128, but donā€™t expect BLYNK_WRITE(128) to be invoked. And donā€™t specify a Refresh Interval of anything other than PUSH. BLYNK_READ(128) wonā€™t work either.

How are you using 128 virtual pins? Are you associating groups of pins with devices? Are all of the virtual pins tied to widgets?

1 Like

All the virtual pins tied to widgets .
I use two devices and bridge widgets.

I wonder if thereā€™s a reason they havenā€™t extended BLYNK_READ and BLYNK_WRITE? It seems odd that you can assign pins 128 - 255 to widgets in the Blynk app, but BLYNK_READ and BLYNK_WRITE donā€™t accept pins 128 - 255. Maybe Iā€™m looking at the wrong library. Iā€™m looking at the master branch,

We could always extend BLYNK_READ and BLYNK_WRITE ourselves, but then we need to maintain the local copy.

1 Like

Yes I dono too.
I have to swap some Vpins below 127 to 128 and above.
So Iā€™ll save vpins for blynk_read

I confirmed that V128 assigned to a Text Input widget is invoked on the device. It invokes GetWriteHandler, however, thereā€™s no BlynkWidgetWrite128 widget write handler. Consequently, GetWriteHandler returns NULL and the thread dies. But the infrastructure is certainly there to support it.

WidgetWriteHandler GetWriteHandler(uint8_t pin)
{
    if (pin >= BLYNK_COUNT_OF(BlynkWriteHandlerVector))
        return NULL;
#ifdef BLYNK_HAS_PROGMEM
    return (WidgetWriteHandler)pgm_read_word(&BlynkWriteHandlerVector[pin]);
#else
    return BlynkWriteHandlerVector[pin];
#endif
}
1 Like

Yeah I think so too.

You use this ā€œFrom App to Deviceā€ function method for any pin over 127ā€¦ Single function for all, but with switch case logic to distinguish individual pins as needed.

1 Like

Thatā€™ll certainly work. Is that the plan? They donā€™t intend to extend the BLYNK_WRITE macro?

And BLYNK_READ_DEFAULT(). Iā€™ll be darn. @Blynk_Coeur, you donā€™t need to reassign any of your pins.

As referenced in that topic, it would apparently just increase the memory usage of the library for the minority of needā€¦ so probably not, at least with this current version of Blynk. Who knows what 2.0 will look like.