Skip to content

Commit fce8e5c

Browse files
author
gemi254
committed
Updated v1.0.9
1 parent a36802b commit fce8e5c

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

examples/ControlAssist-ESPVisualizer/ControlAssist-ESPVisualizer.ino

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1+
// Setting to true will need to upload contents of /data
2+
// directory to esp SPIFFS using image upload
3+
#define USE_SPIFFS_FOR_PAGES false
4+
15
#if defined(ESP32)
26
#include <WebServer.h>
37
WebServer server(80);
48
#include <ESPmDNS.h>
5-
#include "gpioPMemESP32.h"
6-
#define BODY_FILE_NAME "/src/ESPWroom32-Vis.html"
9+
#if USE_SPIFFS_FOR_PAGES
10+
#define BODY_FILE_NAME "/src/ESPWroom32-Vis.html"
11+
#else
12+
#include "gpioPMemESP32.h"
13+
#endif
714
#define TOTAL_PINS 40
815
#else
916
#include <ESP8266mDNS.h>
1017
#include <ESP8266WebServer.h>
1118
ESP8266WebServer server(80);
12-
#define BODY_FILE_NAME "/src/ESP8266Wemos-Vis.html"
13-
//#include "gpioPMemESP8266.h"
19+
#if USE_SPIFFS_FOR_PAGES
20+
#include "gpioPMemESP8266.h"
21+
#else
22+
#define BODY_FILE_NAME "/src/ESP8266Wemos-Vis.html"
23+
#endif
1424
#define TOTAL_PINS 17
1525
#endif
1626

@@ -25,7 +35,7 @@ const char st_pass[]=""; // Put your wifi passowrd.
2535
unsigned long pingMillis = millis(); // Ping millis
2636

2737
#ifndef LED_BUILTIN
28-
#define LED_BUILTIN 22 // Define the pin tha the led is connected
38+
#define LED_BUILTIN 22 // Define the pin tha the led is connected
2939
#endif
3040

3141
// Toggle led on/off and send pin update
@@ -140,7 +150,11 @@ void setup() {
140150
// Setup control assist
141151
ctrl.setup(server, "/");
142152
// Use default CONTROLASSIST_HTML_HEADER and CONTROLASSIST_HTML_FOOTER
143-
ctrl.setHtmlBodyFile(BODY_FILE_NAME);
153+
#if USE_SPIFFS_FOR_PAGES
154+
ctrl.setHtmlBodyFile(BODY_FILE_NAME);
155+
#else
156+
ctrl.setHtmlBody(HTML_PAGE);
157+
#endif
144158
// Bind led
145159
pinMode(LED_BUILTIN, OUTPUT);
146160
digitalWrite(LED_BUILTIN, HIGH); // Turn LED OFF

0 commit comments

Comments
 (0)