We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c74cdb commit 6c83b63Copy full SHA for 6c83b63
libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
@@ -68,15 +68,20 @@ void setup(void) {
68
});
69
70
server.on("/gif", []() {
71
- static const uint8_t gif[] = {
+ static const uint8_t gif[] PROGMEM = {
72
0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, 0x01,
73
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
74
0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x19, 0x8c, 0x8f, 0xa9, 0xcb, 0x9d,
75
0x00, 0x5f, 0x74, 0xb4, 0x56, 0xb0, 0xb0, 0xd2, 0xf2, 0x35, 0x1e, 0x4c,
76
0x0c, 0x24, 0x5a, 0xe6, 0x89, 0xa6, 0x4d, 0x01, 0x00, 0x3b
77
};
78
-
79
- server.send(200, "image/gif", gif, sizeof(gif));
+ char gif_colored[sizeof(gif)];
+ memcpy_P(gif_colored, gif, sizeof(gif));
80
+ // Set the background to a random set of colors
81
+ gif_colored[16] = millis() % 256;
82
+ gif_colored[17] = millis() % 256;
83
+ gif_colored[18] = millis() % 256;
84
+ server.send(200, "image/gif", gif_colored, sizeof(gif_colored));
85
86
87
server.onNotFound(handleNotFound);
0 commit comments