@warner asked how he could control motors through Adafruit-alike Motor Shield in XOD and here is a small library. The shield is tricky one, its H-Bridges are placed behind a shift register chip. I couldn’t express it purely in XOD as it lacks some features yet, so I implemented the node from scratch in C++.
const is used to define a constant, i.e. make the variable read-only. As you’ve seen, it’s not essential for the program to work, but it is good practice to declare variables that shouldn’t change as constant.
Constants can also be defined using constexpr. The initialization of a const variable can be deferred until run time, whereas a constexpr variable must be initialized at compile time. When a variable is initialized at compile time instead of run time, the program may run faster and use less SRAM.