基本文法構造
setup()
loop()
制御文法
if
if…else
for
switch case
while
do… while
break
continue
return
goto
基本文法
; (セミコロン)
{} (大かっこ)
// (シングル行コメント)
/* */ (複数行コメント)
#define
#include
算術演算子
= (代入)
+ -*/ (加減乗除)
% (modulo)
比較演算子
== (equal to)
!= (not equal to)
< (less than)
> (greater than)
<= (less than or equal to)
>= (greater than or equal to)
ブール演算子
&& (and)
|| (or)
! (not)
ポインタ演算子
* dereference operator
& reference operator
ビット演算子
& (bitwise and)
| (bitwise or)
^ (bitwise xor)
~ (bitwise not)
<< (bitshift left)
>> (bitshift right)
複合演算子
++ (increment)
— (decrement)
+= (compound addition)
-= (compound subtraction)
*= (compoundmultiplication)
/= (compound division)
%= (compound modulo)
&= (compound bitwise and)
|= (compound bitwise or) |
定数
HIGH | LOW
INPUT | OUTPUT | INPUT_PULLUP
LED_BUILTIN
true | false
整数の定数
浮動小数点の定数
型
void
boolean
char
unsigned char
byte
int
unsigned int
word
long
unsigned long
short
float
double
string – char array
array
変数スコープ
変数のスコープ
static
volatile
const
応用
sizeof()
PROGMEM
数学関数
min()
max()
abs()
constrain()
map()
pow()
sqrt()
三角関数
sin()
cos()
tan()
乱数
randomSeed()
random() |
デジタル I/O関数
pinMode()
digitalWrite()
digitalRead()
アナログ I/O
analogReference()
analogRead()
analogWrite() – PWM
analogReadResolution()
analogWriteResolution()
その他 I/O
tone()
noTone()
shiftOut()
shiftIn()
pulseIn()
時間関数
millis()
micros()
delay()
delayMicroseconds()
文字検査関数
isAlphaNumeric()
isAlpha()
isAscii()
isWhitespace()
isControl()
isDigit()
isGraph()
isLowerCase()
sPrintable()
isPunct()
isSpace()
isUpperCase()
isHexadecimalDigit()
ビット・バイト
lowByte()
highByte()
bitRead()
bitWrite()
bitSet()
bitClear()
bit()
割り込み関連
attachInterrupt()
detachInterrupt()
interrupts()
noInterrupts()
通信
Serial
Stream
マウス・キーボードUSB (32u4 based boards and Due/Zero only)
Keyboard
Mouse |