• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

esp32 HTML and CSS Basics

Q&A Forum › Category: ESP32 › esp32 HTML and CSS Basics
0 Vote Up Vote Down
x3mvz5pl5g5k asked 1 year ago

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.
Question Tags: CSS, ESP32, html
2 Answers
0 Vote Up Vote Down
DK answered 1 year ago

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";
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

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

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Released] Build Web Servers with ESP32 and ESP8266 (version 1.0) October 27, 2020
  • [eBook Updated] Download Build ESP32-CAM Projects using Arduino IDE (version 1.1) August 31, 2020

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2021 · RandomNerdTutorials.com · All Rights Reserved