stray '\302' in program e stray '\240 in program

Olá pessoas!
Estão dando estes 2 erros no código que criei, vocês sabem como resolver?

qdq:58: error: stray '\240' in program

qdq:58: error: stray '\302' in program

Código

#include<Servo.h>

Servo motor;
Servo motor2;

const int BTN = 2;
const int LED = 13;

int brightness = 0;
int fadeAmount = 5;

volatile int counter = 0;

void setup() {
motor.attach(3);
motor2.attach(4);
attachInterrupt(0, inc, RISING);
}

void inc() {
counter++;
if (counter == 4) {
counter = 4;
}
}

void loop() {
if (counter == 1) {
motor.write(45);
delay(1000);
motor.write(125);
delay(1000);
motor2.write(45);
delay(1000);
motor2.write(125);
delay(1000);
}
else if (counter == 2) {
motor.write(45);
delay(3000);
motor.write(125);
delay(3000);
motor2.write(45);
delay(3000);
motor2.write(125);
delay(3000);
}
else {
motor.write(45);
delay(1000);
motor.write(125);
delay(1000);
motor2.write(45);
delay(1000);
motor2.write(125);
delay(1000);
}
}

Deis de já, grato!

My Portuguese is too rusty to even try to answer in pt.. Hope this helps anyway.

I had a similar issue with a code snippet I copied from somewhere. Rewriting the bit manually fixed the problem. Try that if the script is copied from somewhere.

I think it's about encoding going wrong somehow..

1 Like

As epipolar said, the problem is that your code has "tab" or "spaces" before or after some code. Check it and the code should compile without this error!

1 Like

Caracteres "invisiveis": c++ - Error message "error: stray '\302' in program" - Stack Overflow