Using main function

good afternoon. For experimental purposes, I would like to use the main() function in the sketch and not setup() and loop()

That's OK - you don't have to ask permission.

Then you will not automatically have access to the Arduino libraries, but you must know this.

Might be better not reinventing the wheel.

:wink:

Something like this should work.

int main() {
  init();

  // Setup code here.

  while (true) {
    // Loop code here.
  }
}

You may have to add a call to initVariant() for board specific initialisations.

It he still compiles using the IDE, of course he will. I've done it many times.

Yes, same here.