Index
 
  The Wiring 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: hbarragan [at] uniandes.edu.co
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.
   
Syntax  
delay(milliseconds)
   
Parameters  
milliseconds   int: specified as milliseconds (there are 1000 milliseconds in 1 second)

   
Returns   None
   
Usage   Web & Application
   
Related   delayMicroseconds()