Phil's Arduino C++ Cookbook

The programming language for the Arduino platform is a subset of the C++ programming language. Refer to your laminated Arduino Cheat Sheet, and to https://docs.arduino.cc/language-reference for more detailed information.

Ultimately, like playing a piano, you must learn to program an Arduino by hands-on experience and with practice. This document is only intended as an aid to get you started.

C++ is an imperative language, meaning that you the developer literally tell the computer what to do as you write C++ code. C++ programs consist of declarations, definitions, and statements, all of which shall be discussed in more detail later.

Be advised that the Ardunio project code base does not always use the latest C++ best practices. For example, the parameterless functions in the Arduino sketch skeleton ought to be defined as void setup(void) and void loop(void) instead of the archaic void setup() and void loop().

Background Information

C++ Language Elements

Recipes


Questions or comments to phil@munts.net