Compilation Error in Arduino Code Due to Invisible Unicode Character
Closed this issue · 2 comments
While using the code provided in the Arduino Pro Tutorials for BlinkRedLed_M7, I encountered a compilation error:
Compilation error: stray ‘\302’ in program
This error appears due to an invisible Unicode character in the comment on line 11:
digitalWrite(LEDR, HIGH); // turn the LED off by making the voltage HIGHTo fix this, you can delete the comment on line 11 and retype it, ensuring no hidden characters are present.
Steps to Reproduce
- Copy the code from the tutorial and paste it into the Arduino IDE.
- Attempt to compile.
- Observe the error related to the stray character \302.
Suggested Solution
Please check the code on the tutorial page for any hidden Unicode characters and remove them. Retyping the comment manually on line 11 seems to resolve the issue.
Environment
• Board: Specify board, e.g., Arduino Portenta H7
• Tutorial Link: https://docs.arduino.cc/tutorials/portenta-h7/dual-core-processing/
Additional Context:
This error can be confusing for users, especially those new to Arduino, as it’s caused by invisible characters that are not easily noticeable.
Thanks for reporting this bug @CarlKho-Minerva!
The source files for the tutorial you linked are actually hosted in the arduino/docs-content repository. I submitted a fix for the problem in that file on your behalf: arduino/docs-content#2288
I also checked the code that is hosted in this library and determined that it does not have the same problem. Since no action is needed to resolve the issue in this repository, I'll go ahead and close this. You are welcome to review or monitor arduino/docs-content#2288 to ensure the problem you reported is fixed properly.
thanks man :)