// C++ code //this is an alteration of "button" program that comes in the Arduino IDE const int LedPin=2; //the number of the LED pin on the Arduino Uno const int buttonPin=7; int buttonState=0; //variable for reading pushbutton int counter; int times=0; void setup() { pinMode(LedPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); } void loop() { // read the state of the pushbutton value: buttonState = digitalRead(buttonPin); // check if the pushbutton is pressed. If it is, the buttonState is HIGH: if (buttonState == HIGH) { // turn LED on: digitalWrite(LedPin, HIGH); } else { // turn LED off: digitalWrite(LedPin, LOW); } // digitalWrite(LedPin, HIGH); // delay(100); // Wait for 100 millisecond(s) // digitalWrite(LedPin, LOW); // delay(500); // Wait for 500 millisecond(s) //the following is going to spell out HELLO in Morse Code //H= dot dot dot dot // times=4; // for (counter =0; counter < times; ++counter) // { // digitalWrite(LedPin, HIGH); // delay(100); // Wait for 100 millisecond(s) // digitalWrite(LedPin, LOW); // delay(500); // Wait for 500 millisecond(s) // } // delay(1000); // Wait for 1000 millisecond(s) between letters }