Error while burning bootloader with an arduino mega 2560

Then it is still not working that was the thing I did, same error WHYYYY

I have an empty pin that is with nothing in it. Is this normal? Here is an image of that:

I don't know if this comes with it, it is an extra pin or there was something in it and it was erased, please tell me what happens with it

I am currently programming in Arduino, and I am doing a countdown that haves hours, minutes, and seconds and displays them on a touchscreen (The touchscreen is not essential) the variables of hours, minutes, and seconds are called h1, m1, and s1 so now getting into the problem, when I try to include the s1-- function for decrementing the variable, it just appears the error "no 'operator--(int)' declared for postfix '--' [-fpermissive] which I don't understand, I looked at many forums as possible but those are in another programming language, or it is another type of error, so this is the complete error message:

Arduino: 1.8.19 (Windows 10), Board: "ESP32 Dev Module, Disabled, Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"


ESP32_DISPLAY_V1:891:13: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
s1--;
 ^
exit status 1

no 'operator--(int)' declared for postfix '--' [-fpermissive]

And the code (the code is in Spanish, but h1, m1, and s1 are the only variables that are needed to solve this so the other things are useless for now)

#include "FS.h"
#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library
TFT_eSPI TFT = TFT_eSPI();
#include "teclado.h"
#include <Adafruit_GFX.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_ILI9341.h>
#include <Adafruit_STMPE610.h>
//-------------------DISPLAY--------------------------
#define CALIBRATION_FILE "/TouchCalData3"
#define REPEAT_CAL false
#define TS_MINX 150
#define TS_MINY 130
#define TS_MAXX 3800
#define TS_MAXY 4000
#define FRAME_X 52
#define FRAME_Y 94
#define FRAME_W 135
#define FRAME_H 235

#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W FRAME_W
#define REDBUTTON_H FRAME_H

void touchInterfaz();
void imagenInterfaz();
void imagenBoton();
//-------------------RELE------------------------------
#define pinRele_1 32
#define pinRele_2 35
#define pinRele_3 34

int  m = 0;
int  s = 60;
int  retraso;
bool estado = false;
int  numc = 1;

int m1  = 00;
int m2  = 00;
int m3  = 00;
int m4  = 00;
int m5  = 00;
int m6  = 00;
int m7  = 00;
int m8  = 00;
int m9  = 00;
int m10 = 00;
int m11 = 00;
int m12 = 00;

int h1  = 00;
int h2  = 00;
int h3  = 00;
int h4  = 00;
int h5  = 00;
int h6  = 00;
int h7  = 00;
int h8  = 00;
int h9  = 00;
int h10 = 00;
int h11 = 00;
int h12 = 00;

int d1  = 00;
int d2  = 00;
int d3  = 00;
int d4  = 00;
int d5  = 00;
int d6  = 00;
int d7  = 00;
int d8  = 00;
int d9  = 00;
int d10 = 00;
int d11 = 00;
int d12 = 00;

int s1  = 59;
int s2  = 59;
int s3  = 59;
int s4  = 59;
int s5  = 59;
int s6  = 59;
int s7  = 59;
int s8  = 59;
int s9  = 59;
int s10 = 59;
int s11 = 59;
int s12 = 59;

int tm  = 0;

String dp = ":";
int sp = dp.toInt();
//****************************************************************************************
void setup() {
  Serial.begin(9600);
  //----------------------------------------------------
  pinMode(ledWifi, OUTPUT);
  digitalWrite(ledWifi, HIGH);
  //---------------------
  pinMode(pinRele_1, OUTPUT);
  pinMode(pinRele_2, OUTPUT);
  pinMode(pinRele_3, OUTPUT);
  digitalWrite(pinRele_1, LOW);
  digitalWrite(pinRele_2, LOW);
  digitalWrite(pinRele_3, LOW);
  //----------------------------------------------------
  tft.begin();

  tft.setRotation(0);
  tft.setSwapBytes(true);
  uint16_t calData[5] = { 303, 3452, 412, 3382, 4 };
  tft.setTouch(calData);
  tft.fillScreen(TFT_WHITE);
  imagenInterfaz();
}
//******************************************************************************************

void touchInterfaz(
  String &s1, String &s2,  String &s3,  String &s4,
  String &s5, String &s6,  String &s7,  String &s8,
  String &s9, String &s10, String &s11, String &s12);

void loop() {
  String strg1  = String(d1)  + ":" + String(h1)  + ":" + String(m1)  + ":" + String(s1);
  touchInterfaz(strg1);
}


void touchInterfaz(String &s1) {
  //FUNCION PARA BOTON EN SEGUNDO PLANO
  if (tft.getTouch(&x, &y))
  {
 
    //----------------------------------- ST
    if (x > 64 && x < 121 && y > 185 && y < 212 ) {
     //FUNCTION FOR COUNTDOWN
      while (1 == 1) {
        tft.setTextColor(ILI9341_WHITE, ILI9341_DARKGREEN);
        tft.setTextSize(2);
        tft.setCursor(125, 22);
        tft.print(s12);
        if (s1 == 0) {
          if (m1 > 0) {
            m1--;
          }

          if (m1 == 0) {
            if (h1 > 0) {
              h1--;
            }
            if (h1 == 0) {
              m1 = 60;
            }

            if (m1 == 0) {
              m1 = 0;
            }
          }
          s1 = 60;
          s1--; // WHERE THE ERROR IS
        }
      }
    delay(1000);
    }
  }//FIN tft.getTouch
}
//------------------------------------------------------------------------------------------
//REFRESCO DE DISPLAY
void imagenInterfaz() {
  tft.pushImage(0, 0, animation_width, animation_height, frame);
}
//------------------------------------------------------------------------------------------

I required that the s1 variable goes decrementing every second, (cause it is a function that needs to decrement every 1 second obviously), I did this countdown a lot of time ago, with nearly the same parts but now this error has appeared and I am not able to solve it until now and by the way, the variables that are different from h1, m1, and s1 (like s2, h4, m12) are as well not necessary

if something is not there, let me know, because I needed to cut all the unnecessary functions so this is the part that I need to solve, any answer would be helpful, Thanks if you can answer

Could You post the entire error message? That shows were in the code the error is.

// globally
int s1  = 59;
   :

void touchInterfaz(String &s1) {
  //FUNCION PARA BOTON EN SEGUNDO PLANO
  if (tft.getTouch(&x, &y))
  {
     :
          s1 = 60;
          s1--; // WHERE THE ERROR IS
        }

You have a local parameter variable s1 that is a string, overriding the global s1 that is an int.
strings can't be decremented. Rename the parameter and you should be good.

hmm I went to the code and it is the same thing that u showed there I don't know what do you mean

In Westfw's comment he shows where is the error

You mean this? Then You should know.

Should know what

I mean, it is not a string in my code, if u are talking about s1

you MADE it a string inside the touchIterfaz() function, which is where you are getting the error!

I don't think you can post-decrement a String. Try:

          s1 = 60 - 1;

Your two topics on the same or similar subject have been merged.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

I have one topic that is with a bootloader and another that is with a screen with an esp32 and about a countdown and it has no relation (in my opinion) with an error of a bootloader in an Arduino mega. Weird but can't do anything.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.