Computer Science/Arduino, RB Pi

Arduino] 아두이노 언어 구조, 변수, 함수

TwinParadox 2016. 11. 9. 07:47
728x90

-      아두이노 언어의 구조

구조 종류

내용

제어 구조

(Control Structure)

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

문법(Syntax)

;, {}, //, #define, #include

산술 연산자

(Arithmetic Operators)

=, +, -, *, /, %

비교 연산자

(Comparison Operators)

==, !=, <, >, <=, >=

불 연산자

(Boolean Operators)

&&, ||, !

포인터 접근 연산자

(Pointer Access Operators)

*, &

비트 연산자

(Bitwise Operators)

&, |, ^, ~, <<, >>

복합 연산자

(Compound Operators)

++, --, +=, -=, *=, /=, &=, |=

 

-      아두이노 언어의 변수

변수 종류

내용

상수(Constants)

HIGH/LOW, INPUT/OUTPUT, true/false, integer constants, floating point constants

데이터 형식(Data Types)

void, Boolean, char, unsigned char, byte, int, unsigned int, word, long, unsigned long, float, double, string(배열), String(객체), array

변환(Conversion)

char(), byte(), int(), word(), long(), float()

변수 영역

(Variable Scope & Qualifiers)

variable scope, static, volatile, const

유틸리티(Utilities)

sizeof()

 

-      아두이노 언어의 함수

함수 종류

내용

디지털 입출력(Digital I/O)

pinMode(), digitalWrite(), digitalRead()

아날로그 입출력

(Analog I/O)

analogReference(), analogRead(), analogWrite()-PWm

고급 입출력(Advanced I/O)

tone(), noTone(), shiftOut(), shiftIn(), pulseIn()

시간(Time)

millis(), micros(), delay(), delayMicroseconds()

수학(Math)

min(), max(), abs(), constrain(), map(), pow(), sqrt()

삼각함수(Trigonometry)

sin(), cos(), tan()

난수(Random Numbers)

randomSeed(), random()

비트&바이트(Bits & Bytes)

lowByte(), highByte(), bitRead(), bitWrite(), bitSet(), bitClear(), bit()

외부 인터럽트

(External Interrupts)

attachInterrupt(), detachInterrupt()

인터럽트(Interrupts)

interrupts(), noInterrupts()



이외에도 라이브러리를 추가하면

더 많은 필드와 메소드를 이용할 수 있으며,

이는 아두이노 공식 홈페이지에서 별도로 제공하거나,

소자에 맞게 세팅된 라이브러리에 따라 모두 다르다.


728x90
728x90