Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By tlanfer
#27449
draco wrote:For the image file, I just wrote a tiny python script that read the file in byte by byte and spit out to the console each byte in decimal, separated by a comma. Then I copy/pasted that into a variable for the Arduino sketch. Sorry, I didn't think to save a copy of the python script...

Just FYI: xxd -i <sourcefile> <outputfile> will do exactly that. On Archlinux it comes with the vim package, dont know for other distributions.
User avatar
By woodwax
#27473 Hello

sorry for my newbie question, I would like to use program memory space but the following code doesnt work:

Code: Select all#include <PgmSpace.h>

const char index_html[] PROGMEM = R"=====(
<!DOCTYPE HTML>
<html>
<head><title>ESP8266 Arduino Demo Page</title></head>
<body>ESP8266 power!<p><img src="logo.png"></body>
</html>
)=====";

void setup() {
  Serial.begin(115200);
}

void loop() {
 Serial.println(index_html);
 delay(1000);
}


This is on ESP8266 e12 module with arduino IDE. When I run this code I get wdt error, can anyone correct this code? Thanks