Blynk app button not work

i use sim800l gsm module and arduino uno,

  1. i don’t know what is wrong with my code, it’s just loop invoid(setup), i’m try to remove timer.run() and timer.setInterval(1000L, increment); but it’s work.

  2. for the button in the app sometimes work, it’s make me disappointed

i have try any code with my blynk but it not work when i’m using timer function, someone can help me cause i don’t like use the delay() it’s baddd

        #include <SoftwareSerial.h>
        #include <LCD5110_Graph.h>

        char auth[] = "xxxx";
        char apn[]  = "xxxx";
        char user[] = "xxxx";
        char pass[] = "xxxx";

        LCD5110 lcd(3,4,5,6,7);
        SoftwareSerial SerialAT(12, 11); // RX, TX
        TinyGsm modem(SerialAT);
        WidgetLED led(V11);
        BlynkTimer timer;

        int uptimeCounter, lebar;
        String someStaticData = "SomeStaticData";
        extern uint8_t MediumNumbers[];
        extern uint8_t SmallFont[];

        BLYNK_CONNECTED() {
          //get data stored in virtual pin V0 from server
          Blynk.syncVirtual(V0);
        }

        // restoring counter from server
        BLYNK_WRITE(V0)
        {
          //restoring int value
          uptimeCounter = param[0].asInt();
          //restoring string value
          someStaticData = param[1].asString();
        }

        BLYNK_WRITE(V2)
            {
              if (param.asInt() == 1) {
                 lebar+=5;
              }
             }
        BLYNK_WRITE(V3)
            {
              if (param.asInt() == 1) {
                 if ( lebar >= 5 ){
                 lebar-=5;
                }
             }
            }
        void increment() {
          uptimeCounter++;
          //storing int and string in V0 pin on server
          Blynk.virtualWrite(V0, uptimeCounter, someStaticData);
          //updating value display with uptimeCounter
          Blynk.virtualWrite(V1, uptimeCounter);
          Blynk.virtualWrite(V4, lebar);
        }

        void setup()
        {
          // Debug console
          Serial.begin(9600);
          lcd.InitLCD();
          delay(10);
          SerialAT.begin(38400);
          delay(3000);
          Serial.println("Initializing modem...");  // after more than 30 second my device back here
          modem.restart();
          Blynk.begin(auth, modem, apn, user, pass);
          Serial.println("Initial modem...");
          //timer.setInterval(1000L, increment);
        }

        void loop()
        {
          delay(1000);
          increment();
          lcd.clrScr();
          lcd.setFont(MediumNumbers);
          lcd.printNumI(uptimeCounter, CENTER, 8, 2, '0');
          lcd.setFont(MediumNumbers);
          lcd.printNumI(lebar, CENTER, 25, 2, '0');
          lcd.update();
          Blynk.run();
          //timer.run();
        }

Try it this way

void increment() {
  uptimeCounter++;
  //storing int and string in V0 pin on server
  Blynk.virtualWrite(V0, uptimeCounter, someStaticData);
  //updating value display with uptimeCounter
  Blynk.virtualWrite(V1, uptimeCounter);
  Blynk.virtualWrite(V4, lebar);
  lcd.clrScr();
  lcd.setFont(MediumNumbers);
  lcd.printNumI(uptimeCounter, CENTER, 8, 2, '0');
  lcd.setFont(MediumNumbers);
  lcd.printNumI(lebar, CENTER, 25, 2, '0');
  lcd.update();
}
void setup()
{
  // Debug console
  Serial.begin(9600);
  lcd.InitLCD();
  delay(10);
  SerialAT.begin(38400);
  delay(3000);
  Serial.println("Initializing modem...");  // after more than 30 second my device back here
  modem.restart();
  Blynk.begin(auth, modem, apn, user, pass);
  Serial.println("Initial modem...");
  timer.setInterval(1000L, increment);
}
void loop()
{
  Blynk.run();
  timer.run();
}

If you want the LCD to refresh quicker then the existing uptime timer, then set up another timer interval for the LCD part in it’s own timed loop.

still not work :sob:

Can you provide more detail… will not compile, will not load, will not connect, will not show some or any data on App?.. etc

my modem is blinking and my lcd just blank, i think error on timer.run() so i change it with delay() when it changed my device is working.
but without timer.run() i will use more delay(), it will make more space on my device