Arduino Language Reference 日本語版

基本的にはArduino Language Referenceを和訳したものですが、必要に応じて補足情報を追加しています。単純な機械翻訳の結果ではなく、自然な文章になるように、また、正確なコンピューター用語になるように調整しています。原文にある内容と、筆者が追加した補足情報の区別は明確化しており、補足情報については確かと考えられるもののみ掲載しています。

Arduino プログラミング言語は、関数、値 (変数と定数)、および構造体の 3 つの主要部分に分けることができます。(原文:Arduino programming language can be divided in three main parts: functions, values (variables and constants), and structure.)

関数(Functions)

Arduinoボードの制御と演算を行います。(原文:For controlling the Arduino board and performing computations.)

Digital I/O
digitalRead()
digitalWrite()
pinMode()

Analog I/O
analogRead()
analogReference()
analogWrite()

Zero, Due & MKR Family
analogReadResolution()
analogWriteResolution()

Advanced I/O
noTone()
pulseIn()
pulseInLong()
shiftIn()
shiftOut()
tone()

Time
delay()
delayMicroseconds()
micros()
millis()

Math
abs()
constrain()
map()
max()
min()
pow()
sq()
sqrt()

Trigonometry
cos()
sin()
tan()

Characters
isAlpha()
isAlphaNumeric()
isAscii()
isControl()
isDigit()
isGraph()
isHexadecimalDigit()
isLowerCase()
isPrintable()
isPunct()
isSpace()
isUpperCase()
isWhitespace()

Random Numbers
random()
randomSeed()

Bits and Bytes
bit()
bitClear()
bitRead()
bitSet()
bitWrite()
highByte()
lowByte()

External Interrupts
attachInterrupt()
detachInterrupt()

Interrupts
interrupts()
noInterrupts()

Communication
Serial
SPI
Stream
Wire

USB
Keyboard
Mouse

変数(Variables)

Arduino のデータ型と定数。(原文:Arduino data types and constants.)

Constants
HIGH | LOW
INPUT | OUTPUT | INPUT_PULLUP
LED_BUILTIN
true | false
Floating Point Constants
Integer Constants

Conversion
(unsigned int)
(unsigned long)
byte()
char()
float()
int()
long()
word()

Data Types
array
bool
boolean
byte
char
double
float
int
long
short
size_t
string
String()
unsigned char
unsigned int
unsigned long
void
word

Variable Scope & Qualifiers
const
scope
static
volatile

Utilities
PROGMEM
sizeof()

構造体(Structure)

Arduino (C++) コードの要素。(原文:The elements of Arduino (C++) code.)

Sketch
loop()
setup()

Control Structure
break
continue
do…while
else
for
goto
if
return
switch…case
while

Further Syntax
#define (define)
#include (include)
/* */ (block comment)
// (single line comment)
; (semicolon)
{} (curly braces)

Arithmetic Operators
% (remainder)
* (multiplication)
+ (addition)
- (subtraction)
/ (division)
= (assignment operator)

Comparison Operators
!= (not equal to)
< (less than)
<= (less than or equal to)
== (equal to)
> (greater than)
>= (greater than or equal to)

Boolean Operators
! (logical not)
&& (logical and)
|| (logical or)

Pointer Access Operators
& (reference operator)
* (dereference operator)

Bitwise Operators
& (bitwise and)
<< (bitshift left)
>> (bitshift right)
^ (bitwise xor)
| (bitwise or)
~ (bitwise not)

Compound Operators
%= (compound remainder)
&= (compound bitwise and)
*= (compound multiplication)
++ (increment)
+= (compound addition)
-- (decrement)
-= (compound subtraction)
/= (compound division)
^= (compound bitwise xor)
|= (compound bitwise or)