websrc to .h converter
This commit is contained in:
+10
-25
@@ -1,4 +1,7 @@
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
|
||||
#include "PCA9685.h"
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
@@ -11,6 +14,8 @@
|
||||
|
||||
#include "wifi_credentials.h"
|
||||
|
||||
#include "index.html.h"
|
||||
|
||||
const char* ssid = STASSID;
|
||||
const char* password = STAPSK;
|
||||
|
||||
@@ -19,31 +24,10 @@ ESP8266WebServer server(80);
|
||||
|
||||
void handleRoot() {
|
||||
digitalWrite(led, 1);
|
||||
char temp[400];
|
||||
int sec = millis() / 1000;
|
||||
int min = sec / 60;
|
||||
int hr = min / 60;
|
||||
// char temp[sizeof(index_html)];
|
||||
// snprintf(temp, sizeof(index_html), index_html);
|
||||
|
||||
snprintf(temp, 400,
|
||||
|
||||
"<html>\
|
||||
<head>\
|
||||
<meta http-equiv='refresh' content='5'/>\
|
||||
<title>ESP8266 Demo</title>\
|
||||
<style>\
|
||||
body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
|
||||
</style>\
|
||||
</head>\
|
||||
<body>\
|
||||
<h1>Hello from ESP8266!</h1>\
|
||||
<p>Uptime: %02d:%02d:%02d</p>\
|
||||
<img src=\"/test.svg\" />\
|
||||
</body>\
|
||||
</html>",
|
||||
|
||||
hr, min % 60, sec % 60
|
||||
);
|
||||
server.send(200, "text/html", temp);
|
||||
server.send(200, "text/html", index_html);
|
||||
digitalWrite(led, 0);
|
||||
}
|
||||
|
||||
@@ -161,8 +145,9 @@ void setup() {
|
||||
|
||||
}
|
||||
|
||||
unsigned long i = 0;
|
||||
|
||||
|
||||
unsigned long i = 0;
|
||||
unsigned long a = 0;
|
||||
unsigned long s = 0;
|
||||
float ard_ota_time = 0;
|
||||
|
||||
Reference in New Issue
Block a user