1/29/22, 10:52 AM Arduino Reference - Arduino Reference
Language Reference
Arduino programming language can be divided in three main parts:
functions, values (variables and constants), and structure.
Functions
For controlling the Arduino board and performing computations.
Digital I/O Math Characters
digitalRead() abs() isAlpha()
digitalWrite() constrain() isAlphaNumeric()
pinMode() map() isAscii()
max() isControl()
min() isDigit()
Analog I/O
pow() isGraph()
analogRead()
sq() isHexadecimalDigit()
analogReference()
sqrt() isLowerCase()
analogWrite()
isPrintable()
isPunct()
Trigonometry
Zero, Due & MKR Family isSpace()
cos()
analogReadResolution() isUpperCase()
sin()
analogWriteResolution() isWhitespace()
tan()
Advanced I/O Random Numbers
noTone() random()
pulseIn() randomSeed()
pulseInLong()
shiftIn() Bits and Bytes
shiftOut()
bit()
tone()
bitClear()
bitRead()
Time bitSet()
delay() bitWrite()
delayMicroseconds() highByte()
micros() lowByte()
millis()
https://www.arduino.cc/reference/en/ 1/3
1/29/22, 10:52 AM Arduino Reference - Arduino Reference
External Interrupts Communication
attachInterrupt() Serial
detachInterrupt() Stream
Interrupts USB
interrupts() Keyboard
noInterrupts() Mouse
Variables
Arduino data types and constants.
Constants Data Types Variable Scope & Qualifiers
HIGH | LOW array const
INPUT | OUTPUT | INPUT_PULLUP
bool scope
LED_BUILTIN boolean static
true | false byte volatile
Floating Point Constants char
Integer Constants double
Utilities
float
PROGMEM
int
Conversion sizeof()
long
(unsigned int)
short
(unsigned long)
size_t
byte()
string
char()
String()
float()
unsigned char
int()
unsigned int
long()
unsigned long
word()
void
word
Structure
The elements of Arduino (C++) code.
loop()
Sketch setup()
https://www.arduino.cc/reference/en/ 2/3
1/29/22, 10:52 AM Arduino Reference - Arduino Reference
Control Structure Arithmetic Operators Pointer Access Operators
break % (remainder) & (reference operator)
continue * (multiplication) * (dereference operator)
do...while + (addition)
else - (subtraction)
Bitwise Operators
for / (division)
& (bitwise and)
goto = (assignment operator)
<< (bitshift left)
if
>> (bitshift right)
return
Comparison Operators ^ (bitwise xor)
switch...case
!= (not equal to) | (bitwise or)
while
< (less than) ~ (bitwise not)
<= (less than or equal to)
Further Syntax == (equal to)
Compound Operators
#define (define) > (greater than)
%= (compound remainder)
#include (include) >= (greater than or equal to)
&= (compound bitwise and)
/* */ (block comment)
*= (compound multiplication)
// (single line comment)
Boolean Operators ++ (increment)
; (semicolon)
! (logical not) += (compound addition)
{} (curly braces)
&& (logical and) -- (decrement)
|| (logical or) -= (compound subtraction)
/= (compound division)
^= (compound bitwise xor)
|= (compound bitwise or)
Back to top
https://www.arduino.cc/reference/en/ 3/3