Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • So if I understand you right, this could be done in a header file? I never saw them in the examples I used. But that would make sense... Commented May 11, 2019 at 8:08
  • I think Arduino IDE is doing some "magic" behind the scenes to be able to compile without declaring the functions above the function call. I also updated my examples, to be able to copy and paste them into the corresponding IDEs. Commented May 11, 2019 at 8:21
  • 1
    void myfunction() should not return an int Commented May 11, 2019 at 9:05
  • 2
    @Jan: Indeed. The Arduino IDE edits your .ino file, adds those function prototypes at the beginning of the file, saves the result as a .cpp file, and calls a C++ compiler (g++) to compile that .cpp. Commented May 11, 2019 at 9:29
  • 1
    @Jan, why did you accept an answer which doesn't answer your question? Commented May 11, 2019 at 13:03