Oled display error help

i am getting this error in my code.

Arduino: 1.8.19 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

oleddddd:55:26: error: stray '\342' in program

u8g2.drawUTF8(10, 20, " ":sunny: );

                      ^

oleddddd:55:27: error: stray '\230' in program

u8g2.drawUTF8(10, 20, " ":sunny: );

                       ^

oleddddd:55:28: error: stray '\200' in program

u8g2.drawUTF8(10, 20, " ":sunny: );

                        ^

oleddddd:56:26: error: stray '\342' in program

u8g2.drawUTF8(30, 20, " ":cloud: );

                      ^

oleddddd:56:27: error: stray '\230' in program

u8g2.drawUTF8(30, 20, " ":cloud: );

                       ^

oleddddd:56:28: error: stray '\201' in program

u8g2.drawUTF8(30, 20, " ":cloud: );

                        ^

oleddddd:57:26: error: stray '\342' in program

u8g2.drawUTF8(50, 20, " ":open_umbrella: );

                      ^

oleddddd:57:27: error: stray '\230' in program

u8g2.drawUTF8(50, 20, " ":open_umbrella: );

                       ^

oleddddd:57:28: error: stray '\202' in program

u8g2.drawUTF8(50, 20, " ":open_umbrella: );

                        ^

oleddddd:58:26: error: stray '\342' in program

u8g2.drawUTF8(70, 20, " ":umbrella: );

                      ^

oleddddd:58:27: error: stray '\230' in program

u8g2.drawUTF8(70, 20, " ":umbrella: );

                       ^

oleddddd:58:28: error: stray '\224' in program

u8g2.drawUTF8(70, 20, " ":umbrella: );

                        ^

C:\Users\archi\Desktop\oleddddd\oleddddd.ino:5:44: warning: narrowing conversion of '169' from 'int' to 'char' inside { } [-Wnarrowing]

const char COPYRIGHT_SYMBOL[] = {0xa9, '\0'};

                                        ^

oleddddd:31:1: error: expected unqualified-id before '-' token

  • 13 -

^

oleddddd:62:1: error: expected unqualified-id before '-' token

  • 14 -

^

oleddddd:94:1: error: expected unqualified-id before '-' token

  • 15 -

^

C:\Users\archi\Desktop\oleddddd\oleddddd.ino: In function 'void loop()':

oleddddd:126:6: error: invalid operands of types 'int' and 'void' to binary 'operator-'

  • 16 -

// one tab

u8g2.clearBuffer();


exit status 1

stray '\342' in program



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

Hi! Welcome to the Forum!

In the library documentation, all those symbols (sun, cloud... ) are inside the " ".

If you still have errors after fixing this, please share your complete code in order for people here to take a look.

Where did you copy the code from?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.