How can I make this Arduino script work?

What @pfeerick is explaining is how a normal C++ program would be written. The Arduino system hides a lot of the complexity from you, plus, it doesn’t require you to pre-declare functions before you use them in code.

Tutorial for creating multi cpp file arduino project - #36 by NormanDunbar is something I wrote which explains why this works in Arduino speak, but not in normal C++.

If you are learning C++ from scratch, then perhaps Arduino sketches are not the best starting point. You should be looking at some plain AVR C++ code instead, that is normal C++.

HTH

Cheers,
Norm.

1 Like