[SOLVED] Arduino language

  • These two functions must be present. setup() contains the code that the microcontroller runs once upon being powered, the loop() function contains the code that loops tightly forever.

loop is only tight if you write it tight. If you write a bunch of blocking code in there then it won't loop so tightly anymore.

And you can most definitely have your own main function if you don't want to use the setup / loop paradigm.

It is simply passed to a C++ compiler to finish compilation.

Nope. The C++ compiler doesn't finish the compilation for the IDE, it does the WHOLE compilation procedure. What the IDE does before that is pre-processing, not compilation.

In practical terms the basic Arduino program structure is not event-driven.

That depends on how you write your code. Whether or not it is event driven has nothing to do with it being Arduino or not. You can write event driven code with Arduino.

The loop() should poll heavily for any event it needs, blocking completely.

Polling a pin does not require b locking. Read the pin and move on.

All functions are blocking.

No, they're not. You're on a single core, so you can't run two instructions at once, but that doesn't mean all the code is blocking.

The rest of the arduino.h header file contains other functions commonly used. From a language specification perspective it is more precise than the official documentation.

I'll give you this one. Documentation is scant around here. Your best bet to understand any library is to understand the language and look at the source code.