user63433: How can I summarize dozens of code lines for blinking a red LED in Arduino Rich Shield? Is there a way or method to eliminate at least half of the code for repetitive scenarios?
const int redPin = 4;


void setup()
{
 pinMode(redPin, OUTPUT);
}

void loop()
{
  digitalWrite(redPin, HIGH);
  delay(250);
  digitalWrite(redPin, LOW);
  delay(250);
  digitalWrite(redPin, HIGH);
  delay(250);
  digitalWrite(redPin, LOW);
  delay(250);
  digitalWrite(redPin, HIGH);
  delay(250);
  digitalWrite(redPin, LOW);
}


user33871: void loop()
{
  digitalWrite(redPin, HIGH);
  delay(250);
  digitalWrite(redPin, LOW);
  delay(250);
}

I'm not quite sure what you're after but this is shorter and would get you equivalent results.  Since loop is going to repeat anyway, there's no need to repeat yourself inside loop.  
Per the comments, not that this is particularly useful...
const int redPin = 4;

int counter = 0;

void setup()
{
 pinMode(redPin, OUTPUT);
}

void loop()
{
  if(counter < 4) {
     digitalWrite(redPin, HIGH);
     delay(250);
     digitalWrite(redPin, LOW);
     delay(250);
     counter++;
  }      
}


63433: <p>How can I summarize dozens of code lines for blinking a red LED in Arduino Rich Shield? Is there a way or method to eliminate at least half of the code for repetitive scenarios?</p>

<pre><code>const int redPin = 4;


void setup()
{
 pinMode(redPin, OUTPUT);
}

void loop()
{
  digitalWrite(redPin, HIGH);
  delay(250);
  digitalWrite(redPin, LOW);
  delay(250);
  digitalWrite(redPin, HIGH);
  delay(250);
  digitalWrite(redPin, LOW);
  delay(250);
  digitalWrite(redPin, HIGH);
  delay(250);
  digitalWrite(redPin, LOW);
}
</code></pre>
 33871: <pre><code>void loop()
{
  digitalWrite(redPin, HIGH);
  delay(250);
  digitalWrite(redPin, LOW);
  delay(250);
}
</code></pre>

<p>I'm not quite sure what you're after but this is shorter and would get you equivalent results.  Since loop is going to repeat anyway, there's no need to repeat yourself inside loop.  </p>

<p>Per the comments, not that this is particularly useful...</p>

<pre><code>const int redPin = 4;

int counter = 0;

void setup()
{
 pinMode(redPin, OUTPUT);
}

void loop()
{
  if(counter &lt; 4) {
     digitalWrite(redPin, HIGH);
     delay(250);
     digitalWrite(redPin, LOW);
     delay(250);
     counter++;
  }      
}
</code></pre>
