How to pause the execution time with Arduino IDE - Milliseconds

December 10, 2018 by
How to pause the execution time with Arduino IDE - Milliseconds
Alejandro Jabalquinto

In this post, it will be seen how to pause the execution code for a certain time.聽 Basically, this function pauses the program for a certain time and after this time it continues as normal.聽

The function for pausing the execution code for a certain time using聽Arduino IDE聽is delay().聽 This function is used to set a time of pause.

*With the next version of Industrial Shields boards won鈥檛 be necessary to configure the pins, just selecting the proper board, I/O鈥檚 will be automatically configured.聽

Function

delay(milliseconds);

Parameters

milliseconds: time expressed in milliseconds -> 1000ms = 1 sec

Example

Code Example, blinking of analog outputs:

void setup() {
  pinMode(A0_5, OUTPUT); // configure A0.5 as OUTPUT
}

void loop() {
  analogWrite(A0_5, 0);
  delay(1000);             // delay 1s
  analogWrite(A0_5, 255); 
  delay(1000);
}


Search in our Blog

How to pause the execution time with Arduino IDE - Milliseconds
Alejandro Jabalquinto December 10, 2018
Share this post
Archive

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.


Industrial PLC comparison >>>