Reference for Wiring 1.0 (ALPHA) 0017+. If you have a previous version, use the reference included with your software.
If you see any errors or have any comments, let us know.
Name
delay()
Examples
int pin = 0;
int ledpin = 1;
void setup() {
pinMode(pin, INPUT);
pinMode(ledpin, OUTPUT);
}
void loop() {
if(pin == HIGH) {
digitalWrite(ledpin, HIGH);
} else {
digitalWrite(ledpin, LOW);
}
delay(250); // Stops the program for 250 milliseconds
}
Description
Forces the program to stop running for a specified time. Delay time are specified in thousandths of a second. The function call delay(3000) will stop the program for three seconds.
지정된 시간만큼
프로그램 실행을
정지합니다.
지연시간은 1/1000 초
단위로 지정합니다. delay(3000)은
3 초동안 프로그램이
정지됩니다.
Syntax
delay(milliseconds)
Parameters
milliseconds
int: specified as milliseconds (there are 1000 milliseconds in 1 second)