I’ve finally found the time to read volume 10, so sorry for the late response.
A couple of minor points regarding the Laying Pipes article by @filmote:
On page 17, the TinyURL given for the form to generate a .arduboy info.json file is incorrect. It has 24 appended to the end. The correct URL is
On page 21, the statement is given:
One nice thing about the #define directive is that it allows you to combine values together, like those shown below.
I’d just like to point out that when performing math in a #define, it’s a good practice to enclose the operation in parentheses (round brackets), otherwise you could end up with unexpected results which are hard to debug.
For example: From the example given in the article we have:
#define LARGE 3
#define CAT 10
#define CAT_LARGE CAT + LARGE
int myLargeCat = CAT_LARGE;
The compiler preprocessor will just directly substitute the value for each #define before compiling the line, so the last line will end up as:
int myLargeCat = 10 + 3;
which will correctly assign the value of 13 to variable myLargeCat
However, what if we want to assign the value of 3 times CAT_LARGE, (which would be 13 * 3 = 39) to variable myLargeCatTimes3 ?
If we write
int myLargeCatTimes3 = CAT_LARGE * 3;
the preprocessor will blindly substitute the #defines to end up with
int myLargeCatTimes3 = 10 + 3 * 3;
The compiler will then use mathematical order of operations and perform the multiplication first, resulting in a value of 10 + (3 * 3) = 19 being assigned instead of the expected 39.
If we add parentheses to the #define for CAT_LARGE
#define CAT_LARGE (CAT + LARGE)
The preprocessor’s result will be
int myLargeCatTimes3 = (10 + 3) * 3;
and the compiler will then calculate the expected value 39.