loop()

설명

setup() 함수를 생성한 후, 그것은 초기 변수를 초기화하고 설정하는데, loop() 함수는 그 이름이 암시하는 것을 정확하게 하며, 루프를 반복하여, 프로그램이 바뀌고 응답할 수 있게 허용한다. 그것을 사용하여 아두이노 보드를 능동적으로 제어하시오.

예제 코드

void setup() { // put your setup code here, to executed once: Serial.begin(9600); Serial.println("This is setup code"); } void loop() { // put your main code here, to run repeatedly: Serial.println("This is loop code"); delay(1000); }

The output on Serial Monitor:

COM6
Send
This is setup code This is loop code This is loop code This is loop code This is loop code This is loop code This is loop code This is loop code
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

더보기

ARDUINO BUY RECOMMENDATION

Arduino UNO R3
Arduino Starter Kit
Disclosure: Some links in this section are Amazon affiliate links. If you make a purchase through these links, we may earn a commission at no extra cost to you.
Additionally, some links direct to products from our own brand, DIYables.

※ OUR MESSAGES