Variables

A variable is used to store information that can be referenced or manipulated within the code. A variable is given a unique name which can then be used to access the information. The name of the variable should be something that describes what the variable is so anyone that looks at the code will understand what the variable is used for. Camel case should be used when naming a variable.

Camel case is used when creating a name out of multiple words are phases where the first letter of the name is lowercase, but the beginning of each remaining word is uppercase. Some examples of camel case are ledOne, myVariable and redLedOnRightSide.

When a variable is declared it is usually a good idea to give it an initial value. This helps to ...

Get Mastering Arduino now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.