Stray '\' in Program - Message in 2nd project (8 led blink)

Hay new to all of this. I’m using the Freetronics starter kit with an UNO. I’m following the book and pdf online and copied and pasted the following code for the 2nd project in the book, the 8 led blink.

Code:

int ledCount = 8;
int ledPins = { 6, 7, 8, 9, 10, 11, 12, 13 };
int ledDelay = 300;
void setup() {
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}
void loop() {
for (int thisLed = 0; thisLed < ledCount­1; thisLed++) {
digitalWrite(ledPins[thisLed], HIGH);
delay(ledDelay);
digitalWrite(ledPins[thisLed], LOW);
}
for (int thisLed = ledCount-1; thisLed > 0; thisLed­­) {
digitalWrite(ledPins[thisLed], HIGH);
delay(ledDelay);
digitalWrite(ledPins[thisLed], LOW);
}
}

Error:

sketch_oct29b:2: error: stray ‘’ in program
sketch_oct29b:3: error: stray ‘’ in program
sketch_oct29b:4: error: stray ‘’ in program
sketch_oct29b:6: error: stray ‘’ in program
sketch_oct29b:6: error: stray ‘’ in program
sketch_oct29b:7: error: stray ‘’ in program
sketch_oct29b:11: error: stray ‘’ in program
sketch_oct29b:11: error: stray ‘’ in program
sketch_oct29b:11: error: stray ‘’ in program
sketch_oct29b:12: error: stray ‘’ in program
sketch_oct29b:13: error: stray ‘’ in program
sketch_oct29b:14: error: stray ‘’ in program
sketch_oct29b:16: error: stray ‘’ in program
sketch_oct29b:16: error: stray ‘’ in program
sketch_oct29b:16: error: stray ‘’ in program
sketch_oct29b:16: error: stray ‘’ in program
sketch_oct29b:17: error: stray ‘’ in program
sketch_oct29b:18: error: stray ‘’ in program
sketch_oct29b:19: error: stray ‘’ in program
sketch_oct29b:4: error: expected constructor, destructor, or type conversion before ‘void’
sketch_oct29b:2: error: expected ‘,’ or ‘;’ before ‘u037e’
sketch_oct29b:4: error: expected constructor, destructor, or type conversion before ‘int’

Any help appreciated.

Try this version:

int ledCount = 8;
int ledPins[] = { 
  6, 7, 8, 9, 10, 11, 12, 13 };
int ledDelay = 300;
void setup() {
  for (int thisLed = 0; thisLed < ledCount; thisLed++) {
    pinMode(ledPins[thisLed], OUTPUT);
  }
}
void loop() {
  for (int thisLed = 0; thisLed < ledCount - 1; thisLed++)  
  {
    digitalWrite(ledPins[thisLed], HIGH);
    delay(ledDelay);
    digitalWrite(ledPins[thisLed], LOW);
  }
  for (int thisLed = ledCount-1; thisLed > 0; thisLed--) {
    digitalWrite(ledPins[thisLed], HIGH);
    delay(ledDelay);
    digitalWrite(ledPins[thisLed], LOW);
  }
}

That compiled OK for me.

I’m following the book and pdf online …

The PDF seems to have converted “-” symbols to something the compiler does not recognize.

All the code can be found here:

If you have any questions about your EXP: kit you can email support@freetronics.com or ask on our website forum as well:
Experimenters Kit Example Sketches | Freetronics