Hi - I've copies the following code from Instructables and I get the error message "error: expected unqualified-id before '{' token" whenever I compile. I have checked all brackets and they seem to match to me. It's a simple bit of code, but I can't find what's wrong with it.
Any help very gratefully accepted! Frances :-[
/*
POV
Flashes 8 LEDs fast to form letters: SO LAH
The circuit:
* LED connected from digital pin 5 as "fake ground".
Created 28 July 2010
Copied from Instructables
http://www.instructables.com/id/LilyPad-Wrist-Band-POV/
*/
int ledPin13 = 13; // LED connected to digital pin 13
int ledPin12 = 12; // LED connected to digital pin 12
int ledPin11 = 11; // LED connected to digital pin 11
int ledPin10 = 10; // LED connected to digital pin 10
int ledPin9 = 9; // LED connected to digital pin 9
int ledPin8 = 8; // LED connected to digital pin 8
int ledPin7 = 7; // LED connected to digital pin 7
int ledPin6 = 6; // LED connected to digital pin 6
int ground = 5; // LED connected to digital 5 fake ground
int ledPinArray[8] = {
6,7,8,9,10,11,12,13};
void setup() {
// initialize the digital pin as an output:
for(int i = 0; i < 8; i++){
pinMode(ledPinArray[i],OUTPUT);
}
pinMode(ground, OUTPUT);
digitalWrite(ground, LOW);
}
for(int i = 0; i < 8; i++){
digitalWrite(ledPinArray[i],HIGH);
}
delay(1000); // wait for a second
for(int i = 0; i < 8; i++){
digitalWrite(ledPinArray[i],LOW);
}
delay(1000); // wait for a second
}