0% found this document useful (0 votes)
79 views2 pages

Language Reference: Structure Variables Functions

An Arduino program can be divided into three main parts: structure, values (variables and constants), and functions. The structure includes functions like setup() and loop() that control the program flow. Values are things like variables, constants, and data types. Functions allow manipulating inputs and outputs like digital I/O, analog I/O, and advanced functions for timing, math, and communication.

Uploaded by

razor13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views2 pages

Language Reference: Structure Variables Functions

An Arduino program can be divided into three main parts: structure, values (variables and constants), and functions. The structure includes functions like setup() and loop() that control the program flow. Values are things like variables, constants, and data types. Functions allow manipulating inputs and outputs like digital I/O, analog I/O, and advanced functions for timing, math, and communication.

Uploaded by

razor13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Language Reference

Arduino programs can be divided in three main parts: structure, values (variables and
constants), and functions. http://arduino.cc/en/Reference/HomePage

Structure Variables Functions


setup() Constants Digital I/O
loop() HIGH | LOW pinMode()
INPUT | OUTPUT | digitalWrite()
Control Structures INPUT PULLUP digitalRead()
if LED BUILTIN
if...else true | false Analog I/O
for integer constants analogReference()
switch case floating point analogRead()
while constants analogWrite() - PWM
do... while
break D a t a Ty p e s Advanced I/O
continue tone()
void
return noTone()
boolean
goto shiftOut()
char
shiftIn()
unsigned char
Fu r t h e r S y n t a x pulseIn()
byte
; (semicolon) int
unsigned int Time
{} (curly braces)
word millis()
// (single line
long micros()
comment)
unsigned long delay()
/* */ (multi-line
float delayMicroseconds()
comment)
#define double
#include string - char array Math
String - object min()
array max()
Arithmetic
abs()
Operators
Conversion constrain()
= (assignment map()
operator) char() pow()
+ (addition) byte() sqrt()
- (subtraction) int()
* (multiplication) word()
/ (division) long()
% (modulo) float()
Trigonometry
sin()
Va r i a b l e S c o p e &
cos()
Comparison Q u a l i fi e r s tan()
Operators variable scope
== (equal to) static Random Numbers
!= (not equal to) volatile randomSeed()
< (less than) const random()
> (greater than)
<= (less than or equal U t i l i t i e s Bits and Bytes
to) sizeof() lowByte()
>= (greater than or highByte()
equal to) bitRead()
PROGMEM
bitWrite()
Boolean Operators bitSet()
&& (and) bitClear()
|| (or) bit()
! (not)
External Interrupts
Pointer Access attachInterrupt()
Operators detachInterrupt()
* dereference
Interrupts
operator
interrupts()
& reference operator
noInterrupts()
B i t w i s e O p e r at o r s
Communication
& (bitwise and) Serial
| (bitwise or)
^ (bitwise xor)
~ (bitwise not)
<< (bitshift left)
>> (bitshift right)

Compound
Operators
++ (increment)
-- (decrement)
Compounds
+= (addition)
-= (subtraction)
*= (multiplication)
/= (division)
&= (bitwise and)

|= (bitwise or)

You might also like