Skip to main content
1 of 2
Nick Gammon
  • 38.9k
  • 13
  • 70
  • 126

See my post about How the IDE organizes things.

Also see my page about how to avoid the quirks of the IDE sketch file pre-preprocessing.

You can certainly manage without .ino files. As Edgar Bonet says, they are really C++ files with certain pre-processing (see link above).

but what about these loop() and setup() functions

Effectively, the Arduino IDE supplies a main function that looks like this:

int main ()
  {
  init ();    // initialize hardware, including timers and timer interrupts
  setup ();   // user setup
  while (true)
    loop ();  // stuff to be done repeatedly
  return 0;   // this will never be executed
  }

(It's slightly more complex, to allow for USB where applicable, but that is the idea).

But still I did not found the step by step guide how to do it.

I'm pretty sure there are a lot of example "make" files around which show the idea.

I have an example here.

Nick Gammon
  • 38.9k
  • 13
  • 70
  • 126