I keep getting "a function-definition is not allowed here before '{' token"
this come after I have re-arranged my code several times, my code is supposed to make an LED blink "hello welcome to mechatronics" in morse code.
int led=13;// the led pin
char input;// to save the input
void setup () {
pinMode(led, OUTPUT);
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
if (Serial.available()) {
input = Serial.read();//read the input
void H() {d();d();d();d();p();d();p();d();l();d();d();p();d();l();d();d();p();l();l();l();pause();d();l();l();p();d();p();d();l();d();d();p();l();d();l();d();p();l();l();l();p();l();l();p();d();pause();l();p();l();l();l();pause();l();l();p();d();p();l();d();l();d();p();d();d();d();d();p();d();l();p();l();p();d();l();d();p();l();l();l();p();l();d();p();d();d();p();l();d();l();d();p();d();d();d();
}
void d () {digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(200);} // wait
void l () {digitalWrite(led, HIGH);
delay(600);
digitalWrite(led, LOW);
delay(200);}
void p () {delay(600);} //space bewteen letter
void pause() {delay(1400);} //space between word
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
You cannot use “pause” as a variable of function name, it is reserved, that is why it is a different colour than your other functions