Stray 342 error

When this sketch is compiled a stray 342 error results. I appreciate any help.

#include 

// Defines the Arduino pins that will be used to control LEDs
#define BVS_RUNNING     6
#define BVS_SRE         9
#define BVS_DATA_FWD    10

// Defines the constants that will be passed as parameters to 
// the BVSP.begin function
const unsigned long STATUS_REQUEST_INTERVAL = 2000;
const unsigned long STATUS_REQUEST_TIMEOUT = 1000;

// Initializes a new global instance of the BVSP class
BVSP bvsp = BVSP();

void setup() 
{
  // Starts serial communication at 115200 bps
  Serial.begin(115200);
  
  // Sets the Arduino pin modes
  pinMode(BVS_RUNNING, OUTPUT);
  pinMode(BVS_SRE, OUTPUT);
  pinMode(BVS_DATA_FWD, OUTPUT);
  
  // Sets the Arduino serial port that will be used for 
  // communication, how long it will take before a status request 
  // times out and how often status requests should be sent to 
  // BitVoicer Server
  bvsp.begin(Serial, STATUS_REQUEST_TIMEOUT, 
    STATUS_REQUEST_INTERVAL);
}

void loop() 
{
  // Checks if the status request interval has elapsed and if it 
  // has, sends a status request to BitVoicer Server
  bvsp.keepAlive();
  
  // Checkes if there is data available at the serial port buffer 
  // and processes its content according to the specifications 
  // of the BitVoicer Server Protocol
  bvsp.receive();
  
  // Gets the respective status from the BVSP class and sets 
  // the LEDs on or off
  digitalWrite(BVS_RUNNING, bvsp.isBVSRunning());
  digitalWrite(BVS_DATA_FWD, bvsp.isDataFwdRunning());
  digitalWrite(BVS_SRE, bvsp.isSREAvailable());
}

Please post the full error message. There should be a Copy error messages button on the right side of the orange bar after getting the error. Please use code tags for the error message.

Please post a link to where you downloaded the BVSP library.

The Arduino is presenting me the same mistakes that you did several things but I could not solve.

  1. Update the java .
  2. download previous versions 1.6.7 and 1.6.5
  3. We compile and always get the same error.

Versions will be error or problem is compactness of ascii or unicode. What should be done to fix it. My Windows is version 8.1.

Regards

ORLANDO GUZMAN

If the error message referred to a stray \342 in the code it is most likely to have been caused by copying the code from a Web page which has Unicode characters in it.

Until we see the complete error message we will not know. Incidentally, copying the code from this thread into the IDE and compiling it does not produce that error.

This code:

define M1A 19 //Motor 1A

define M1B 18 //Motor 1B

define M2A 17 //Motor 2A

define M2B 16 //Motor 2B

define S1 0 //IZQ

define S2 1 //DER

define UMBRAL 200 //Umbral de los sensores

unsigned long timeserial;

void setup (){ Serial.begin(9600); timeserial = millis(); pinMode(M1A, OUTPUT); pinMode(M1B, OUTPUT); pinMode(M2A, OUTPUT); pinMode(M2B, OUTPUT); STOP(10000); analogWrite(PIN_PWM, VEL); }void loop() byte SDER = (analogRead(S1)> UMBRAL )?0:1; byte SIZQ = (analogRead(S2)> UMBRAL )?0:1; if(SDER && SIZQ) STOP(0); else if (!SDER && SIZQ) DER(0); else if (SDER && !SIZQ) IZQ(0); else ADE(0); if(millis() – timeserial > 500){ timeserial = millis(); Serial.print('Sensor1: '); //Serial.print(SDER); Serial.print(analogRead(S1)); Serial.print(' Sensor2: '); //Serial.println(SIZQ); Serial.println(analogRead(S2)); }

void ADE(uint16_t time){ digitalWrite(M1A, LOW); digitalWrite(M1B, HIGH); digitalWrite(M2A, LOW); digitalWrite(M2B, HIGH); delay(time); void DER(){ //Llanta Izquierda digitalWrite(M1A, HIGH); digitalWrite(M1B, LOW); //llanta Derecha digitalWrite(M2A, LOW); digitalWrite(M2B, HIGH); delay(time);

void IZQ( ){ //Llanta Izquierda digitalWrite(M1A, LOW); digitalWrite(M1B, HIGH); //Llanta Derecha digitalWrite(M2A, HIGH); digitalWrite(M2B, LOW); delay(time); }

void STOP(){ digitalWrite(M1A, LOW); digitalWrite(M1B, LOW); digitalWrite(M2A, LOW); digitalWrite(M2B, LOW); delay(time); }

I am upgrading and I stopped working

This msge error

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -hardware "C:\Users\Visitante\AppData\Local\Arduino15\packages" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -tools "C:\Users\Visitante\AppData\Local\Arduino15\packages" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\Visitante\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -ide-version=10607 -build-path "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp" -warnings=null -prefs=build.warn_data_percentage=75 -verbose "C:\Users\Visitante\Documents\Arduino\cny70uno\cny70uno.ino" C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -hardware "C:\Users\Visitante\AppData\Local\Arduino15\packages" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -tools "C:\Users\Visitante\AppData\Local\Arduino15\packages" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\Visitante\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -ide-version=10607 -build-path "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp" -warnings=null -prefs=build.warn_data_percentage=75 -verbose "C:\Users\Visitante\Documents\Arduino\cny70uno\cny70uno.ino" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp\sketch\cny70uno.ino.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp\sketch\cny70uno.ino.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp\sketch\cny70uno.ino.cpp" -o "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp\preproc\ctags_target_for_gcc_minus_e.cpp" "C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino5/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp\preproc\ctags_target_for_gcc_minus_e.cpp" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp\sketch\cny70uno.ino.cpp" -o "C:\Users\VISITA~1\AppData\Local\Temp\builde8c64c0823a292aa8f2e26b928981c33.tmp\sketch\cny70uno.ino.cpp.o" cny70uno:30: error: stray '\342' in program

if(millis() – timeserial > 500){

^

cny70uno:30: error: stray '\200' in program

cny70uno:30: error: stray '\223' in program

C:\Users\Visitante\Documents\Arduino\cny70uno\cny70uno.ino:32:22: warning: character constant too long for its type [enabled by default]

Serial.print('Sensor1: ');

^

C:\Users\Visitante\Documents\Arduino\cny70uno\cny70uno.ino:35:22: warning: character constant too long for its type [enabled by default]

Serial.print(' Sensor2: ');

^

C:\Users\Visitante\Documents\Arduino\cny70uno\cny70uno.ino: In function 'void setup()':

cny70uno:17: error: 'STOP' was not declared in this scope

STOP(10000);

^

cny70uno:18: error: 'PIN_PWM' was not declared in this scope

analogWrite(PIN_PWM, VEL);

^

cny70uno:18: error: 'VEL' was not declared in this scope

analogWrite(PIN_PWM, VEL);

^

C:\Users\Visitante\Documents\Arduino\cny70uno\cny70uno.ino: At global scope:

cny70uno:22: error: expected initializer before 'if'

if(SDER && SIZQ)

^

cny70uno:24: error: expected unqualified-id before 'else'

else if (!SDER && SIZQ)

^

cny70uno:26: error: expected unqualified-id before 'else'

else if (SDER && !SIZQ)

^

cny70uno:28: error: expected unqualified-id before 'else'

else

^

cny70uno:30: error: expected unqualified-id before 'if'

if(millis() – timeserial > 500){

^

C:\Users\Visitante\Documents\Arduino\cny70uno\cny70uno.ino: In function 'void ADE(uint16_t)':

cny70uno:46: error: a function-definition is not allowed here before '{' token

void DER(){

^

cny70uno:71: error: expected '}' at end of input

}

^

exit status 1 stray '\342' in program

After adding the bunch of missing '}', some defines, some parameter definitions, it compiles.

The stray unicode char vanished in the copy process somehow.

#define M1A 19 //Motor 1A
#define M1B 18 //Motor 1B
#define M2A 17 //Motor 2A
#define M2B 16 //Motor 2B
#define S1 0  //IZQ
#define S2 1  //DER
#define _UMBRAL_ 200 //Umbral de los sensores

#define PIN_PWM  3
#define VEL 128

unsigned long timeserial;

void setup () {
  Serial.begin(9600);
  timeserial = millis();
  pinMode(M1A, OUTPUT);
  pinMode(M1B, OUTPUT);
  pinMode(M2A, OUTPUT);
  pinMode(M2B, OUTPUT);
  STOP(10000);
  analogWrite(PIN_PWM, VEL);
}
void loop() {
  byte SDER = (analogRead(S1) > _UMBRAL_ ) ? 0 : 1;
  byte SIZQ = (analogRead(S2) > _UMBRAL_ ) ? 0 : 1;
  if (SDER && SIZQ)
    STOP(0);
  else if (!SDER && SIZQ)
    DER(0);
  else if (SDER && !SIZQ)
    IZQ(0);
  else
    ADE(0);
  if (millis() - timeserial > 500) {
    timeserial = millis();
    Serial.print(F("Sensor1: "));
    //Serial.print(SDER);
    Serial.print(analogRead(S1));
    Serial.print(F(" Sensor2: "));
    //Serial.println(SIZQ);
    Serial.println(analogRead(S2));
  }
}
void ADE(unsigned long time) {
  digitalWrite(M1A, LOW);
  digitalWrite(M1B, HIGH);
  digitalWrite(M2A, LOW);
  digitalWrite(M2B, HIGH);
  delay(time);
}
void DER(unsigned long time) {
  //Llanta Izquierda
  digitalWrite(M1A, HIGH);
  digitalWrite(M1B, LOW);
  //llanta Derecha
  digitalWrite(M2A, LOW);
  digitalWrite(M2B, HIGH);
  delay(time);
}
void IZQ( unsigned long time) {
  //Llanta Izquierda
  digitalWrite(M1A, LOW);
  digitalWrite(M1B, HIGH);
  //Llanta Derecha
  digitalWrite(M2A, HIGH);
  digitalWrite(M2B, LOW);
  delay(time);
}

void STOP(unsigned long time) {
  digitalWrite(M1A, LOW);
  digitalWrite(M1B, LOW);
  digitalWrite(M2A, LOW);
  digitalWrite(M2B, LOW);
  delay(time);
}
Der Sketch verwendet 3.560 Bytes (11%) des Programmspeicherplatzes. Das Maximum sind 30.720 Bytes.
Globale Variablen verwenden 204 Bytes (9%) des dynamischen Speichers, 1.844 Bytes für lokale Variablen verbleiben. Das Maximum sind 2.048 Bytes.
Serial.print(' Sensor2: ');

Double quotes, not singles.

pert: Please use code tags for the error message.

Please post a link to where you downloaded the BVSP library.

Please use code tags

:)

The error message was saying that the thing that looks like a minus sign in this line was actually a weird Unicode character (possibly an EN-Dash).

 if(millis() - timeserial > 500){

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

When verifying the code it gives me this message: stray \'342' in program and the line starting with void loop is highlighted.

The code is my project No.3 in the Experimenters Kit

You've got way more errors showing than just the stray \342.

Read the answer above yours. Also read:

https://stackoverflow.com/questions/20420890/getting-errors-stray-342-and-200-and-214

"You are using a Zero Width Non Joiner character after the >> in your code. This is a unicode character that is encoded in UTF-8 as three characters with values 0x2e, 0x80, 0x8c (or in base 8, \342, \200, \214). This probably happened because you copy and pasted some code from a document (html web page?) that uses those special characters."

Here's what my IDE said re errors:

Arduino: 1.8.8 (Windows 10), Board: "Arduino MKR WiFi 1010"

sketch_dec30c:1:1: error: stray '\342' in program

 int​ ledCount = 14; int​ ledPins[] = { 6, 7, 8, 9, 10, 11, 12, 13, 12, 11, 10, 9, 8, 7 }; int​ ledDelay = 300; int​ buttonPin = 2; 

 ^

sketch_dec30c:1:1: error: stray '\200' in program

sketch_dec30c:1:1: error: stray '\213' in program

sketch_dec30c:1:1: error: stray '\342' in program

sketch_dec30c:1:1: error: stray '\200' in program

sketch_dec30c:1:1: error: stray '\213' in program

sketch_dec30c:1:1: error: stray '\342' in program

sketch_dec30c:1:1: error: stray '\200' in program

sketch_dec30c:1:1: error: stray '\213' in program

sketch_dec30c:1:1: error: stray '\342' in program

sketch_dec30c:1:1: error: stray '\200' in program

sketch_dec30c:1:1: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

  void​ ​setup​() {   ​for​ (​int​ thisLed = 0; thisLed < ledCount; thisLed++) {     ​pinMode​(ledPins[thisLed], ​OUTPUT​);    }   pinMode​(buttonPin, ​INPUT​); } 

  ^

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:2:2: error: stray '\342' in program

sketch_dec30c:2:2: error: stray '\200' in program

sketch_dec30c:2:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

  void​ ​loop​() {   ​for​ (​int​ thisLed = 0; thisLed < ledCount-1; thisLed++) {     ​digitalWrite​(ledPins[thisLed], ​HIGH​);     ​delay​(ledDelay);     ​while​(​digitalRead​(buttonPin) == ​HIGH​) {       ​delay​(10);     }     ​digitalWrite​(ledPins[thisLed], ​LOW​);   } } 

  ^

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

sketch_dec30c:3:2: error: stray '\342' in program

sketch_dec30c:3:2: error: stray '\200' in program

sketch_dec30c:3:2: error: stray '\213' in program

exit status 1
stray '\342' in program

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

You can see all sorts of shit like:

"void​ ​loop​()"

Assuming this is copy-pasted, try cleaning up the code...

There are a bunch of hidden bad characters in your code. This often occurs when you copy some code from a website that has done some weird formatting voodoo.

If you do Tools > Fix Encoding and Reload, you'll be able to see all the garbage characters. Remove all that and the problem will be solved.

By the way, smashing a bunch of code into a single line is really a bad idea. It won't make your program take up any less memory on the Arduino board. It will only make it much more difficult for everyone to read the code.

1 Like

UKHeliBob: If the error message referred to a stray \342 in the code it is most likely to have been caused by copying the code from a Web page which has Unicode characters in it.

Until we see the complete error message we will not know. Incidentally, copying the code from this thread into the IDE and compiling it does not produce that error.

I'm having this kind of problem as well, I copied a code from a web site and the same error ocurred, any solution?

blannkin: I'm having this kind of problem as well, I copied a code from a web site and the same error ocurred, any solution?

Do any of the suggestions already in this thread help? How about Tools > Fix Encoding and Reload as per pert's reply #11?

i copied my code from a word file and i got the same erorr

i found a way that u can paste ur code on a matlab online executer it will show u a red dash in ur code. u have to delete them all and the code will work. this the link for the website http://www.tutorialspoint.com/matlab/try_matlab.php

I had this problem when I copied in an equation from a word document. When I hand-typed it in and compiled it was all good.

It was helpful…my problem is solved