Description
Integer constants are numbers that are used directly in a sketch, like 123. By default, these numbers are treated as int but you can change this with the U and L modifiers (see below).
Normally, integer constants are treated as base 10 (decimal) integers, but special notation (formatters) may be used to enter numbers in other bases.
Base | Example | Formatter | Comment |
---|---|---|---|
10 (decimal) |
123 |
none |
|
2 (binary) |
B1111011 |
leading 'B' |
only works with 8 bit values (0 to 255) characters 0&1 valid |
8 (octal) |
0173 |
leading "0" |
characters 0-7 valid |
16 (hexadecimal) |
0x7B |
leading "0x" |
characters 0-9, A-F, a-f valid |