(FIRST POST - 1ST 24 HOURS WITH MY ARDUINO UNO)
Ok. A quick background on me.
I specialize in Home Automation and install/program High End Residential & Commercial using Control4.
So I'm not new to programming, just new to Arduino Programming
I could certainly accomplish this in Control4 (which of course is completely different from what we are talking about), but I'm wondering how to accomplish this on an Arduino Uno. As everyone knows the beauty of the Arduino is that it can accomplish basic tasks at a fraction of the price of other controllers.
I see that people on these forums can be pretty nasty in the beginning to people who don't speak Arduino Lingo, so I ask, please take it easy on me at first.
My example is just going to be an example, which I would like to use over and over again for different applications using the Arduino.
For this example I'm going to flip a switch to the off position (no continuity to ground) and have an LED blink 3 times. Once that LED Blinks 3 times I want it to stop. Then once I flip that switch to the On position (back to ground) have the Arduino ready to look at the first IF statement again in regards to when the switch flips to the off position. Like a Security Sensor contact, only make a Buzz sound once, until its closed and opened again etc....
Hope I write this properly for you. I tried to cut out all the fat so I don't get confused and my example makes sense.
const int ledPin = 13;
const int Switch = 5;
int SwitchPosition = 0;
void setup() {
 //I presume that this "setup location" only means that the Arduino will run this once during the inatial boot Correct?
pinMode(ledPin, OUTPUT);
pinMode(Switch, INPUT);
}
void loop() {
 // THIS IS WHERE I JUST WANT THE LED TO BLINK 3 TIMES WHEN THE SWITCH IS "HIGH" THEN STOP, UNTIL THE SWITCH IS FLIPPED LOW THEN HIGH AGAIN
 SwitchPosition = digitalRead(Switch);
if (SwitchPosition ==HIGH) {
 //blink the LED 3 Times.... Again only want it 3 times, and not to repeat until triggered again.Â
  // turn LED on: Â
  digitalWrite(ledPin, HIGH);Â
  delay(150);
  digitalWrite(ledPin, LOW);
  delay(150);
  digitalWrite(ledPin, HIGH);Â
  delay(150);
  digitalWrite(ledPin, LOW);
  delay(150);
  digitalWrite(ledPin, HIGH);Â
  delay(150);
  digitalWrite(ledPin, LOW);
  }
  else {
     // turn LED off:
  digitalWrite(ledPin, LOW);
  }
}
Please let me know if you have ANY questions.
Thanks in advance,
DJM