When using the Arduino core library, you normally do not write a
main()
function function. Instead, you write setup() and loop() and rely on the
core'slibcore's provided main() to callfor calling them.
If you nevertheless want to provide your own main(), then you should call
call init();
before your (with no arguments) before you try to use the library. Adding just
Adding this single call makes your program work on my Uno.
However, since it does not seem to be officially documented, this trick
work for memay not be safe against upgrades in the core library. Writing setup()
and loop() should be more future-proof.