Programming Glossary
This programming glossary defines some of the most commonly used programming terms throughout this book. It doesn’t include operators and symbols.
- #define
The
#define
operator defines a value that persists throughout an entire application. For instance:#define NUMBER 4
Now the constant
NUMBER
will represent the value 4 throughout the application.- #ifdef
The
#ifdef
operator checks whether something has been defined using the#define
keyword. It must be followed by#endif
.- #ifndef
The
#ifndef
operator checks whether something has not been defined using the#define
keyword. It must be followed by#endif
.- amp
This is short for ampere and is a electrical measurement of how much electrical current is flowing in a circuit. It is equal to the voltage divided by the resistance.
- analog pin
On the Arduino, the analog pins enable reading of voltage. The voltage on the pin is interpreted as an integer value in the range of 0 to 1,023.
- array
An array is a collection of variables that are accessed with an index number. An array is declared with a length or with initializers that determine the length. The following code declares an array of six elements with the first element at
arr[0]
and the last atarr[5]
:int arr[6];
Processing arrays are created like so:
int arr = new int[6];
In C++, declaring the array initializes each element in the array when the object is created only if the array is declared in the class:
class myClass {int arr[6]; // will be created when an instance of // myClass ...
Get Programming Interactivity 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.