Вы находитесь на странице: 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)

Вам также может понравиться