• 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

Web Servers with the ESP32 and ESP8266 – 1.1 Hello World Web Server

Q&A Forum › Web Servers with the ESP32 and ESP8266 – 1.1 Hello World Web Server
0 Vote Up Vote Down
Ferdinando Dossena asked 2 years ago
8 Answers
0 Vote Up Vote Down
Ferdinando Dossena answered 2 years ago

Good night,
in the e-book on page 163 “Creating the Web Page” you explain the keyword “PROGMEM“, but on line 21 of the main.cpp file we read: “const char index_html [] PROGMEM = R” rawliteral (… “
what does the “R” mean?
Thanks

1 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi Ferdinando.
You are not the first person asking that. So, I think the explanation must be a little confusing. I’ll need to fix that in the next eBook update.

As for the R”rawliteral. The R means “Treat everything between these delimiters as a raw string”. That is, everything between “rawliteral”(at the beginning of the string) and “rawliteral”(at the end of the string).
Instead of the word “rawliteral” you can use any other word as a delimiter.

Let me know if this is clear. If not, I’ll try to explain in another way.

I hope you are enjoying the eBook.

Regards,
Sara

0 Vote Up Vote Down
Ferdinando Dossena answered 2 years ago

Hi Sara, 
thank you very much, now it’s clear. Where can I find a list of these parameters? Thanks again.
Ferdinando

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
What parameters are you referring to?
Regards,
Sara

0 Vote Up Vote Down
Ferdinando Dossena answered 2 years ago

I’m refering to “R”. 
Are there other parameters for PROGMEM like R?
I suppose PROGMEM is a directive to the compiler …
Thanks
Regard
Ferdinando

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi again.

The “R” is not specific to the PROGMEM.

The “R” is one thing and PROGMEM is another. In this case, we’re combining both together.

The PROGMEM keyword is a variable modifier, it tells the compiler “put this information into flash memory”, instead of into SRAM, where it would normally go. You can learn more here: https://www.arduino.cc/reference/en/language/variables/utilities/progmem/

About the “R”, it allows you to spread a String on different lines using delimiters.

I hope this is clear.

Regards,
Sara

0 Vote Up Vote Down
Ferdinando Dossena answered 2 years ago

Hi Sara, now its very clear. I had forgotten the function of the PROGMEM keyword. Thanks.
Best regards
Ferdinando

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Great!
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.
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 Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

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

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

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.