// the external LED is attached to this pin. // onboard LED is attached to pin 13, int ledPin = 13; // slider of potentiometer attached to this analog input int analogInPin = 0; // length of a dot int dotTime = 300; // even though we are not using it yet, make sure the // pushbutton is set up correctly // the pushbutton is attached to this digital input pin int buttonPin = 9; // the value read from the pushbutton int buttonValue; void setup() { // configure ledPin to be a digital output pinMode(ledPin, OUTPUT); // set buttonPin to INPUT and // turn on internal pull up resistor pinMode(buttonPin, INPUT); digitalWrite(buttonPin, HIGH); } void loop() { // send out an O: - - - // dash 1 // a dash is 3 dots long digitalWrite(ledPin, HIGH); delay(3 * dotTime); // an inter-element gap is one dot digitalWrite(ledPin, LOW); delay(dotTime); // dash 2 digitalWrite(ledPin, HIGH); delay(3 * dotTime); digitalWrite(ledPin, LOW); delay(dotTime); // dash 3 digitalWrite(ledPin, HIGH); delay(3 * dotTime); digitalWrite(ledPin, LOW); delay(dotTime); // and a short gap between O and the next character delay(2 * dotTime); }