I am getting the following error when trying to upload the code for this section:
Arduino: 1.8.10 (Windows 10), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 115200, None" ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:15:25: error: stray '#' in program background-color: #4CAF50; ^ ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:25:25: error: stray '#' in program background-color: #555555; ^ ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:1:1: error: expected unqualified-id before '<' token <!DOCTYPE html> ^ ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:14:5: error: expected unqualified-id before '.' token .button { ^ ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:24:5: error: expected unqualified-id before '.' token .button2 { ^ ESP32_Bluetooth_Classic_with_Arduino_IDE_-_Getting_Started_-_Ra:27:3: error: expected unqualified-id before '<' token </style> ^ exit status 1 stray '#' in program This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
2 Answers
hi
is your html code inside?
const char index_html[] PROGMEM = R"rawliteral()rawliteral";
example
const char index_html[] PROGMEM = R"rawliteral( <!DOCTYPE HTML> <html> <head> <title>Hello World</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { background-color: #4CAF50; } </style> </head> <body> </body> </html>)rawliteral";
Hi.
Can you share your code with us?
Are you trying to upload the code in that section to Arduino IDE?
The code given in that section is pure HTML. It will not work directly on Arduino IDE.
You need to follow the next unit “HTML in Arduino IDE” to learn how to include the HTML text on Arduino IDE to build the web server.
Regards,
Sara