Last year you dragged blocks. This year you type. But you are not starting again — you already know everything this book is about.
That is the important part, and most books get it wrong. Typing code is not a new subject. It is the same ideas you used last year — do this, then that; repeat; if something, then something else — written in a different notation.
So for the first six sessions, every new thing arrives next to the block you already know. Block on the left, the line that does exactly the same thing on the right. By Session 6 the left column falls away and you write from an empty file.
Same shape as last year, with two additions.
Listings look like this. The numbers down the left are line numbers — they are not part of the program, they are so this book can say “look at line 4”.
void, if, HIGH.pinMode, delay.// is a comment, ignored by the board.You do not need to memorise this. Come back to it whenever something will not compile.
delay(1000); — the semicolon is how C++ knows the line is finished. Blocks did not need one because the block's edge was the ending.{ needs its }. They do the job the C-shape of a block used to do.digitalWrite works. digitalwrite does not. DigitalWrite does not.delay(1000) — the 1000 is how long, and it goes inside, exactly like the white oval in a block.Reference pages