Constants are built in to the Arduino language to make it easier for programmers to read and write code. They work by finding these words or characters in your program and replacing them with the more complex names for the same object. For example, pin 8 is replaced with "pb0".

All except 'true' and 'false' are specific to the Arduino language and the Arduino IDE (integrated development environment). Don't count on these to work with other programming languages.


When used with pinMode(OUTPUT) and digitalWrite(), HIGH means 5V is sent to the pin you specify. LOW means 0V is sent to the pin.

When used with pinMode(INPUT) or pinMode(INPUT_PULLUP) and digitalRead(), HIGH means that the pin is reporting at least 3 volts. LOW means the pin is reporting less than 3 volts.


true or false

The word false is converted to a 0 in the code. The word true is actually defined as all 'non-zero' numbers. You can do math with true and false. For example, (false-true) is equal to -1.


INPUT:pinMode(2, INPUT);
OUTPUT:pinMode(2, OUTPUT);

The function pinMode() can accept three different arguments as its second argument. INPUT, INPUT_PULLUP, and OUTPUT change how the pin behaves at a very basic level.

Pins defined as an OUTPUT can supply more power to the components connected to them.

Pins defined as an INPUT_PULLUP will normally return HIGH from digitalRead() and LOW when activated.

Pins defined as INPUTs are unpredictable when they are inactive. They usually require a resistor to provide predictable results.


pin numbers

When you type a pin number into your code and the upload it to the Maker Board, the pin numbers are actually replaced with locations on port registers. 

go to top