[SOLVED] Maximum WidgetLed Number

Good evening everyone.
I am completing the sketch that makes me the house home automation. (I’ll publish it soon will be fully working).
Unfortunately I noticed a limitazine use of WidgetLed. Reached 10 WidgetLed, successive no longer work. Unfortunately I was not aware of this limit, and I had to stop.
anyone is aware of this limitation.

Thanks in advance to all.

Use the simple method and just send 0-255 value to the LEd over virtualwrite()

Blynk.virtualWrite(LED_PIN,255); // led on

I personally find the WidgetLed method to be a waste of setup code.

Thank you,
I enclose the part of the code that activates the LED on me that tells me that the light is on.

WidgetLED LedExtSerr03 (V3);

const int MonExtSerr03 = 3;

ButtonStateExtSerr03 boolean = false;

ButtonWidgetExtSerr03 void ()
{
// Reading was contact
boolean IsPressed = (digitalRead (MonExtSerr03) == LOW);

// If the state changes (from open to closed).
if (IsPressed! = ButtonStateExtSerr03) {
if (IsPressed) {
LedExtSerr03.on ();
Serial.println (ButtonStateExtSerr03);
} Else {
LedExtSerr03.off ();
Serial.println (ButtonStateExtSerr03);
}
ButtonStateExtSerr03 = IsPressed;
}
}

pinMode (MonExtSerr03, INPUT_PULLUP);

timer.setInterval (ritardotimer, ButtonWidgetExtSerr03);

In summary when the contact closes on App warns me that the light is on.

As well as it is written and it works, but the eleventh LEDs that add, this is ignored.

Thanks in advance for any suggestions

Most MCU’s don’t have more than 10 pins, what MCU are you using?

Arduino Mega 2560

@macignolo timer has a maximum of 10 for each instance. Call another instance for another 10 timers.

I do not understand, you may be more clear. Perhaps with an example.
What do you mean by another instance?

Thank you

where you have timer also make a timer1 (for 11 to 20 timers) and timer2 (for 21 to 30) etc.

Ok, but I create a second instance Timer1, Timer2, Etc.
Excuse me, but I find it difficult.
Thank you again

Ok, but how do you create a second instance Timer1, Timer2, Etc.
Excuse me, but I find it difficult.
Thank you again

There is no listed limit of LED widgets (or any others, short of projects space and energy). I have recently experimented with a dot matrix of 20 widget LEDS… and they all work, most of the time, but if I changed numbers (displayed on the matrix) too quickly, then sometimes only part of the widget LEDs “lit” up. No error msg or disconnect, but still caused by too much data flow causing some widget LED commands to be ignored.

#include <SimpleTimer.h>

SimpleTimer timer;
SimpleTimer timer1;

However it does not work. It does not go beyond the first 10 WidgetLed.
I’ll wait patiently.
Good night to all and thanks for the support

#include <SimpleTimer.h>

SimpleTimer timer;
SimpleTimer timer1;

However it does not work. It does not go beyond the first 10 WidgetLed.
I’ll wait patiently.
Good night to all and thanks for the support

It does.

You will also have timer1.run() in loop() and for the 11th button it will be:

timer1.setInterval (x, y);

I forgot about that… SimpleTimer has the limit of 10 instances per timer. Making @macignolo issues more timer related than too much data as was in my case.

Sorry for any red herrings @macignolo :wink:

Problem solved.
Dovo have created the Timer1 instance, I had started in LOOP.
Now it works correctly.

Thanks for the support