Problem with the LCD device

Hello,

I want to try my LCD device but it doesn't work. So I try to to another program, shorter, but it doesn't work too. And I don't understand the error message:

Arduino : 1.6.5 (Windows 7), Carte : "Arduino/Genuino Uno"

Les options de compilation ont été modifiées, tout sera recompilé

Utilisation de la bibliothèque LiquidCrystal prise dans le dossier : C:\Program Files\Arduino\libraries\LiquidCrystal

C:\Program Files\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files\Arduino\hardware\arduino\avr\variants\standard -IC:\Program Files\Arduino\libraries\LiquidCrystal\src C:\Users\Laure\AppData\Local\Temp\build1719851196773534796.tmp\test_ecran.cpp -o C:\Users\Laure\AppData\Local\Temp\build1719851196773534796.tmp\test_ecran.cpp.o

test_ecran.ino:4:1: error: stray '' in program
test_ecran.ino:5:1: error: 'u037e' does not name a type
test_ecran.ino:4:35: error: expected ',' or ';' before 'u037e'
stray '' in program

Here is my code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12,11,3,5,0,10);
void setup() {
lcd.begin(16, 2);
}
void loop() {
lcd.setCursor(0, 0);
lcd.print("test");
lcd.setCursor(0, 1);
lcd.print("test");
}

I found your problem and it so well camouflaged, that it should be fixed/blocked by the Arduino team.

Somehow you managed to exchange an ordinary ';' (0x3B) by its UNICODE? representation ';' (0xBECD).

The compiler makes a difference, the human eye, copy operations, forum do not.

Here some code that revealed the problem

void dump(byte* adr, unsigned int len = 0x80);

char testS[] = "LiquidCrystal lcd(12,11,3,5,0,10);";
char testS1[] = "LiquidCrystal lcd(12,11,3,5,0,10);";

void setup() {
  Serial.begin(115200);
  dump((byte*)testS, strlen(testS));
  dump((byte*)testS1, strlen(testS1));
}

void loop() {}

char hexNibble(byte val) {
  val &= 0xF;
  if (val > 9) {
    return val + 'A' - 10;
  } else {
    return val + '0';
  }
}

void hexByte(char* store, byte val) {
  store[1] = hexNibble(val);
  store[0] = hexNibble(val >> 4);
}

char* toHex(unsigned int val, bool isAdr = false) {
  static char textBuf[7];
  if (isAdr) {
    hexByte(textBuf, (byte)(val >> 8));
    hexByte(textBuf + 2, (byte)val);
    textBuf[4] = ':';
    textBuf[5] = ' ';
    textBuf[6] = 0;
  } else {
    hexByte(textBuf, (byte)val);
    textBuf[2] = ' ';
    textBuf[3] = 0;
  }
  return textBuf;
}

void dump(byte* adr, unsigned int len) {
  int lines = (len + 15) >> 4;
  bool moreThanOneLine = (lines != 1);
  byte bytes;
  for (; lines--; adr += 16, len -= 16) {
    Serial.write(toHex((unsigned int)adr, true));
    for (bytes = 0; bytes < 16; bytes++) {
      if (bytes < len) {
        Serial.write(toHex(adr[bytes]));
      } else if (moreThanOneLine) {
        Serial.print(F("   "));
      }
    }
    Serial.print(F("'"));
    for (bytes = 0; bytes < 16; bytes++) {
      if (bytes < len) {
        Serial.write(adr[bytes] < 0x20 ? '.' : adr[bytes]);
      }
    }
    Serial.print(F("'\r\n"));
  }
}
0223: 4C 69 71 75 69 64 43 72 79 73 74 61 6C 20 6C 63 'LiquidCrystal lc'
0233: 64 28 31 32 2C 31 31 2C 33 2C 35 2C 30 2C 31 30 'd(12,11,3,5,0,10'
0243: 29 CD BE                                        ');'
0200: 4C 69 71 75 69 64 43 72 79 73 74 61 6C 20 6C 63 'LiquidCrystal lc'
0210: 64 28 31 32 2C 31 31 2C 33 2C 35 2C 30 2C 31 30 'd(12,11,3,5,0,10'
0220: 29 3B                                           ');'

So for your sketch, retyping the closing ';' in the lcd() statement will remove the compiler errors.

One more note: I doubt that using pin 0 is a good choice, pins 0 and 1 are used for serial and sketch-upload.

Gapier:
test_ecran.ino:4:1: error: stray '' in program
test_ecran.ino:5:1: error: 'u037e' does not name a type
test_ecran.ino:4:35: error: expected ',' or ';' before 'u037e'
stray '' in program

Not every character that looks like a semicolon ';' is a semicolon.

Character 'u037e' is a UNICODE character that looks like a semicolon, but the compiler doesn't see a semicolon in the source code, but a UNICODE character with the code 'u037e'.

So in the line

LiquidCrystal lcd(12,11,3,5,0,10);

remove the character that looks like a semicolon, then replace with another semicolon entered from the keyboard.

BTW: Arre you really sure to use pin-0 as a data pin for the LCD?
If you do so, you will be unable to use Serial for debugging your sketch on most Arduino boards (i.e. "UNO" or "MEGA").

And always be careful copying source code from a HTML webpage into the Arduino compiler! Webpages often use UNICODE code tables and UNICODE characters are sometimes not the same ASCII characters as they look alike.

Thanks very much