본문 바로가기

아두이노-스케치

다양한 아두이노 명령어 사용법 - 레퍼런스




아두이노를 사용하여 프로그래밍할 때 필요한  많은 명령어들이 있습니다. 

모두가 자주 사용하는 명령어는 아니지만 모두 잘 알고 있어야 합니다.


프로그램 실행시 명령어 하나 하나가 무엇인지 알려고 하지 마세요.

일단 실행되고 나서 결과값이 나오면 그러한 문장, 프로그램 코드가 어떤 역할을 하는지 대략

예상만 하시고 직접 코드를 타이핑하고 결과를 확인하는 식으로 익혀가시면 됩니다. 그게 또 빠른 방법입니다.

반드시 타이핑 하고 결과를 확인해야 합니다. 눈으로 익히는것은 오래가지 못하고 금방 잃어버립니다.


아두이노 프로그램 명령어가 궁금하실때 언제든지 여기 오셔서 확인하시면 됩니다. 




Language Reference 출처:

https://www.arduino.cc/en/Reference/HomePage

Arduino programs can be divided in three main parts: structurevalues (variables and constants), andfunctions.

Structure

Control Structures

Further Syntax

Arithmetic Operators

  • = (assignment operator)
  •  (addition)
  • - (subtraction)
  • * (multiplication)
  • / (division)
  • % (modulo)

Comparison Operators

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

Boolean Operators

  • && (and)
  • || (or)
  • ! (not)

Pointer Access Operators

Bitwise Operators

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

Compound Operators

  • ++ (increment)
  • -- (decrement)
  • += (compound addition)
  • -= (compound subtraction)
  • *= (compound multiplication)
  • /= (compound division)
  • %= (compound modulo)
  • &= (compound bitwise and)
  • |= (compound bitwise or)

Variables

Constants

Data Types

Conversion

Variable Scope & Qualifiers

Utilities

Functions

Digital I/O

Analog I/O

Due & Zero only

Advanced I/O

Time

Math

Trigonometry

Characters

Random Numbers

Bits and Bytes

External Interrupts

Interrupts

Communication

USB (32u4 based boards and Due/Zero only)

Looking for something else?

See the libraries page for interfacing with particular types of hardware. Try the list of community-contributed code. The Arduino language is based on C/C++. It links against AVR Libc and allows the use of any of its functions; see its user manualfor details.

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.