Could someone please let me know what is wrong with this code? I have looked and looked but cannot see why an error is generated.
// Project 2 - SOS Morse Code Signaler
// LED connected to digital pin 10
int ledPin = 10;
// run once, when the sketch starts
voidsetup() {
// sets the digital pin as output
pinMode(ledPin, OUTPUT);
}
// run over and over again
void loop() {
// 3 dits
for (int x=0; x<3; x++) {
digitalWrite(ledPin, HIGH);
delay(150);
digitalWrite(ledPin, LOW);
delay(100);
}
// 100ms delay to cause slight gap between letters
delay(100);
// 3 dahs
for (int x=0; x<3; x++) {
digitalWrite(ledPin, HIGH);
delay(400);
digitalWrite(ledPin, LOW);
delay(100);
}
// 100ms delay to cause slight gap between letters
delay(100);
// 3 dits again
for (int x=0; x<3; x++) {
digitalWrite(ledPin, HIGH);
delay(150);
digitalWrite(ledPin, LOW);
delay(100);
}
// wait 5 seconds before repeating the SOS signal
delay(5000);
}/code]
Error Message:
Arduino: 1.6.3 (Mac OS X), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
sketch_may18b.ino:5:11: error: ISO C++ forbids declaration of 'voidsetup' with no type [-fpermissive]
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Thanks
Brian