Skip to content
Snippets Groups Projects
Commit 73d2fd80 authored by Malte Schmitz's avatar Malte Schmitz
Browse files

Add web configuration

parent f5fcb7a8
Branches master
No related tags found
No related merge requests found
......@@ -15,4 +15,6 @@ framework = arduino
lib_deps =
Adafruit NeoPixel
TaskScheduler
Base64
ESP_EEPROM
monitor_speed = 115200
\ No newline at end of file
......@@ -4,25 +4,55 @@ const char html_index[] PROGMEM = R"=====(
<head lang="de">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Campfire</title>
<title>Blinklicht</title>
<style>
* {
font-family: sans-serif;
font-size: 20pt;
}
</style>
</head>
<body>
<h1>Campfire</h1>
<h1>Blinklicht</h1>
<h2>Text</h2>
<p>
Text:<br>
<input type="text" id="text" value="paris"><br>
</p>
<p><button id="setText">Setzen</button></p>
<h2>Morse-Code</h2>
<p>
Morse-Code:<br>
<input type="text" id="morse">
</p>
<p>
Buchstaben pro Minute:<br>
<input type="text" id="bpm" value="25">
</p>
<div>
Red <input type="range" min="0" max="255" id="red" value="226">
Green <input type="range" min="0" max="255" id="green" value="121">
Blue <input type="range" min="0" max="255" id="blue" value="35">
</div>
<p>
Farbe An:<br>
<input type="text" id="onColor" value="white"></input><br>
<span id="onColors"></span>
</p>
<p id="display"></p>
<p>
Farbe Aus:<br>
<input type="text" id="offColor" value="black"></input><br>
<span id="offColors"></span>
</p>
<p><button id="setMorse">Setzen</button></p>
<h2>Steuer-Code</h2>
<textarea id="code" rows="40" cols="40"></textarea>
<p><button id="setCode">Setzen</button></p>
<script>
function httpGetAsync(theUrl){
......@@ -30,25 +60,455 @@ const char html_index[] PROGMEM = R"=====(
xmlHttp.open("GET", theUrl, true);
xmlHttp.send(null);
}
const display = document.getElementById("display");
function hex(i) {
return ("0" + (+i).toString(16)).substr(-2);
const morseCode = {
'a': '.-',
'b': '-...',
'c': '-.-.',
'd': '-..',
'e': '.',
'f': '..-.',
'g': '--.',
'h': '....',
'i': '..',
'j': '.---',
'k': '-.-',
'l': '.-..',
'm': '--',
'n': '-.',
'o': '---',
'p': '.--.',
'q': '--.-',
'r': '.-.',
's': '...',
't': '-',
'u': '..-',
'v': '...-',
'w': '.--',
'x': '-..-',
'y': '-.--',
'z': '--..',
'1': '.----',
'2': '..---',
'3': '...--',
'4': '....-',
'5': '.....',
'6': '-....',
'7': '--...',
'8': '---..',
'9': '----.',
'0': '-----',
' ': ' ',
};
const colors = [
"black",
"silver",
"gray",
"white",
"maroon",
"red",
"purple",
"fuchsia",
"green",
"lime",
"olive",
"yellow",
"navy",
"blue",
"teal",
"aqua",
"orange",
"aliceblue",
"antiquewhite",
"aquamarine",
"azure",
"beige",
"bisque",
"blanchedalmond",
"blueviolet",
"brown",
"burlywood",
"cadetblue",
"chartreuse",
"chocolate",
"coral",
"cornflowerblue",
"cornsilk",
"crimson",
"cyan",
"darkblue",
"darkcyan",
"darkgoldenrod",
"darkgray",
"darkgreen",
"darkkhaki",
"darkmagenta",
"darkolivegreen",
"darkorange",
"darkorchid",
"darkred",
"darksalmon",
"darkseagreen",
"darkslateblue",
"darkslategray",
"darkturquoise",
"darkviolet",
"deeppink",
"deepskyblue",
"dimgray",
"dodgerblue",
"firebrick",
"floralwhite",
"forestgreen",
"gainsboro",
"ghostwhite",
"gold",
"goldenrod",
"greenyellow",
"grey",
"honeydew",
"hotpink",
"indianred",
"indigo",
"ivory",
"khaki",
"lavender",
"lavenderblush",
"lawngreen",
"lemonchiffon",
"lightblue",
"lightcoral",
"lightcyan",
"lightgoldenrodyellow",
"lightgray",
"lightgreen",
"lightpink",
"lightsalmon",
"lightseagreen",
"lightskyblue",
"lightslategray",
"lightsteelblue",
"lightyellow",
"limegreen",
"linen",
"magenta",
"mediumaquamarine",
"mediumblue",
"mediumorchid",
"mediumpurple",
"mediumseagreen",
"mediumslateblue",
"mediumspringgreen",
"mediumturquoise",
"mediumvioletred",
"midnightblue",
"mintcream",
"mistyrose",
"moccasin",
"navajowhite",
"oldlace",
"olivedrab",
"orangered",
"orchid",
"palegoldenrod",
"palegreen",
"paleturquoise",
"palevioletred",
"papayawhip",
"peachpuff",
"peru",
"pink",
"plum",
"powderblue",
"rosybrown",
"royalblue",
"saddlebrown",
"salmon",
"sandybrown",
"seagreen",
"seashell",
"sienna",
"skyblue",
"slateblue",
"slategray",
"snow",
"springgreen",
"steelblue",
"tan",
"thistle",
"tomato",
"turquoise",
"violet",
"wheat",
"whitesmoke",
"yellowgreen",
"rebeccapurple",
];
const colorCodes = {
"black": 0x01,
"silver": 0x02,
"gray": 0x03,
"grey": 0x03,
"white": 0x04,
"maroon": 0x05,
"red": 0x06,
"purple": 0x07,
"fuchsia": 0x08,
"green": 0x09,
"lime": 0x0a,
"olive": 0x0b,
"yellow": 0x0c,
"navy": 0x0d,
"blue": 0x0e,
"teal": 0x0f,
"aqua": 0x10,
"orange": 0x11,
"aliceblue": 0x12,
"antiquewhite": 0x13,
"aquamarine": 0x14,
"azure": 0x15,
"beige": 0x16,
"bisque": 0x17,
"blanchedalmond": 0x18,
"blueviolet": 0x19,
"brown": 0x1a,
"burlywood": 0x1b,
"cadetblue": 0x1c,
"chartreuse": 0x1d,
"chocolate": 0x1e,
"coral": 0x1f,
"cornflowerblue": 0x20,
"cornsilk": 0x21,
"crimson": 0x22,
"cyan": 0x23,
"aqua": 0x23,
"darkblue": 0x24,
"darkcyan": 0x25,
"darkgoldenrod": 0x26,
"darkgray": 0x27,
"darkgrey": 0x27,
"darkgreen": 0x28,
"darkkhaki": 0x29,
"darkmagenta": 0x2a,
"darkolivegreen": 0x2b,
"darkorange": 0x2c,
"darkorchid": 0x2d,
"darkred": 0x2e,
"darksalmon": 0x2f,
"darkseagreen": 0x30,
"darkslateblue": 0x31,
"darkslategray": 0x32,
"darkslategrey": 0x32,
"darkturquoise": 0x33,
"darkviolet": 0x34,
"deeppink": 0x35,
"deepskyblue": 0x36,
"dimgray": 0x37,
"dimgrey": 0x37,
"dodgerblue": 0x38,
"firebrick": 0x39,
"floralwhite": 0x3a,
"forestgreen": 0x3b,
"gainsboro": 0x3c,
"ghostwhite": 0x3d,
"gold": 0x3e,
"goldenrod": 0x3f,
"greenyellow": 0x40,
"grey": 0x41,
"honeydew": 0x42,
"hotpink": 0x43,
"indianred": 0x44,
"indigo": 0x45,
"ivory": 0x46,
"khaki": 0x47,
"lavender": 0x48,
"lavenderblush": 0x49,
"lawngreen": 0x4a,
"lemonchiffon": 0x4b,
"lightblue": 0x4c,
"lightcoral": 0x4d,
"lightcyan": 0x4e,
"lightgoldenrodyellow": 0x4f,
"lightgray": 0x50,
"lightgrey": 0x50,
"lightgreen": 0x51,
"lightpink": 0x52,
"lightsalmon": 0x53,
"lightseagreen": 0x54,
"lightskyblue": 0x55,
"lightslategray": 0x56,
"lightslategrey": 0x56,
"lightsteelblue": 0x57,
"lightyellow": 0x58,
"limegreen": 0x59,
"linen": 0x5a,
"magenta": 0x5b,
"fuchsia": 0x5b,
"mediumaquamarine": 0x5c,
"mediumblue": 0x5d,
"mediumorchid": 0x5e,
"mediumpurple": 0x5f,
"mediumseagreen": 0x60,
"mediumslateblue": 0x61,
"mediumspringgreen": 0x62,
"mediumturquoise": 0x63,
"mediumvioletred": 0x64,
"midnightblue": 0x65,
"mintcream": 0x66,
"mistyrose": 0x67,
"moccasin": 0x68,
"navajowhite": 0x69,
"oldlace": 0x6a,
"olivedrab": 0x6b,
"orangered": 0x6c,
"orchid": 0x6d,
"palegoldenrod": 0x6e,
"palegreen": 0x6f,
"paleturquoise": 0x70,
"palevioletred": 0x71,
"papayawhip": 0x72,
"peachpuff": 0x73,
"peru": 0x74,
"pink": 0x75,
"plum": 0x76,
"powderblue": 0x77,
"rosybrown": 0x78,
"royalblue": 0x79,
"saddlebrown": 0x7a,
"salmon": 0x7b,
"sandybrown": 0x7c,
"seagreen": 0x7d,
"seashell": 0x7e,
"sienna": 0x7f,
"skyblue": 0x80,
"slateblue": 0x81,
"slategray": 0x82,
"slategrey": 0x82,
"snow": 0x83,
"springgreen": 0x84,
"steelblue": 0x85,
"tan": 0x86,
"thistle": 0x87,
"tomato": 0x88,
"turquoise": 0x89,
"violet": 0x8a,
"wheat": 0x8b,
"whitesmoke": 0x8c,
"yellowgreen": 0x8d,
"rebeccapurple": 0x8e,
}
function submit(event) {
const red = document.getElementById("red").value;
const green = document.getElementById("green").value;
const blue = document.getElementById("blue").value;
const h = "0x" + hex(red) + hex(green) + hex(blue);
display.innerHTML = "red: " + red + " green: " + green + " blue: " + blue + "<br>" + h;
httpGetAsync("set?red=" + red + "&green=" + green + "&blue=" + blue);
const textInput = document.getElementById("text");
const morseInput = document.getElementById("morse");
const bpmInput = document.getElementById("bpm");
const onColorInput = document.getElementById("onColor");
const onColors = document.getElementById("onColors");
const offColorInput = document.getElementById("offColor");
const offColors = document.getElementById("offColors");
const codeInput = document.getElementById("code");
function createColorButtons(container, target) {
colors.forEach(color => {
const el = document.createElement("span");
el.setAttribute("title", color);
el.style.cursor = "pointer";
el.style.background = color;
el.style.display = "inline-block";
el.style.width = "14px";
el.style.height = "14px";
el.style.margin = "2px";
el.style.border = "solid 1px black";
el.addEventListener("click", () => {
target.value = color;
});
container.appendChild(el);
});
}
const red = document.getElementById("red");
const green = document.getElementById("green");
const blue = document.getElementById("blue");
red.addEventListener("change", submit);
green.addEventListener("change", submit);
blue.addEventListener("change", submit);
submit();
createColorButtons(onColors, onColorInput);
createColorButtons(offColors, offColorInput);
function setText() {
const t = textInput.value.toLowerCase();
var morse = "";
for (var i = 0; i < t.length; i++) {
const c = morseCode[t.charAt(i)];
if (c) {
morse += c + " ";
}
}
morseInput.value = morse;
};
function setMorse() {
const m = morseInput.value;
var onColor = onColorInput.value;
if (!colorCodes[onColor]) {
onColor = "white";
}
var offColor = offColorInput.value;
if (!colorCodes[offColor]) {
offColor = "black;"
}
const bpm = +bpmInput.value || 25;
const dit = Math.round(6000 / bpm);
const dah = dit * 3;
var code = [];
for (var i = 0; i < m.length; i++) {
const c = m.charAt(i);
if (c === ".") {
code.push(onColor + " " + dit);
code.push(offColor + " " + dit);
} else if (c === "-") {
code.push(onColor + " " + dah);
code.push(offColor + " " + dit);
} else if (c === " ") {
code.push(offColor + " " + 3 * dit);
}
}
codeInput.value = code.join("\n");
};
function setCode() {
const code = codeInput.value.split(/\r?\n/);
var data = code.map(c => c.trim()).filter(c => c.length > 0).
map(c => {
const [colorStr, delayStr] = c.split(/\s+/);
var colorCode = colorCodes[colorStr];
if (!colorCode) {
console.error("Unknown color " + colorStr);
colorCode = colorCodes["black"];
}
var delay = Math.round(+delayStr / 10);
if (delay < 1 || delay > 255) {
console.error("Invalid delay " + delayStr);
delay = 10;
}
return String.fromCharCode(colorCode, delay);
}).join("");
httpGetAsync("?code=" + btoa(data));
};
setText();
setMorse();
const setTextButton = document.getElementById("setText");
setTextButton.addEventListener("click", () => {
setText();
setMorse();
setCode();
});
const setMorseButton = document.getElementById("setMorse");
setMorseButton.addEventListener("click", () => {
setMorse();
setCode();
});
const setCodeButton = document.getElementById("setCode");
setCodeButton.addEventListener("click", setCode);
</script>
</body>
......
#include <Adafruit_NeoPixel.h>
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <TaskScheduler.h>
#include <Base64.h>
#include <ESP_EEPROM.h>
#include "send_progmem.h"
#include "html_index.h"
#define SSID "baustelle"
#define PASSWD "baustelle"
#define SSID "blinklicht01"
#define PASSWD "blinklicht"
#define NEO_PIN D3
#define NUM_PIXELS 8
// TODO https://arduino-esp8266.readthedocs.io/en/latest/libraries.html#eeprom
#define EEPROM_SIZE 2048
// LED directly on the ESP chip // LED_BUILTIN is an external LED
#define LED D4
Adafruit_NeoPixel pixels(NUM_PIXELS, NEO_PIN, NEO_GRB + NEO_KHZ800);
int wpm = 25;
int dit = 6000 / wpm;
int dah = 3 * dit;
const byte DNS_PORT = 53;
IPAddress apIP(172, 217, 28, 1);
DNSServer dnsServer;
ESP8266WebServer server(80);
void serveIndex();
void handleSet();
void handleOther();
void t1Callback();
Task t1(1000, -1, &t1Callback);
......@@ -35,10 +36,7 @@ Task t1(1000, -1, &t1Callback);
Scheduler runner;
int pos = 0;
String code = "-. --- --- -.- ";
bool state = false;
//void update();
String code;
void setup() {
pinMode(LED, OUTPUT);
......@@ -55,13 +53,22 @@ void setup() {
t1.enable();
WiFi.mode(WIFI_AP);
WiFi.disconnect();
WiFi.softAP(SSID,PASSWD);
// Set up HTTP-Server
server.on("/",serveIndex);
server.on("/set",handleSet);
server.onNotFound(handleOther);
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
WiFi.softAP(SSID, PASSWD);
dnsServer.start(DNS_PORT, "*", apIP);
server.on("/", serveIndex);
server.onNotFound(serveIndex);
server.begin();
EEPROM.begin(EEPROM_SIZE);
char data[EEPROM_SIZE];
EEPROM.get(0, data);
code = String(data);
if (code.length() == 0) {
code = "\x01\x10";
}
}
void update(int color) {
......@@ -72,111 +79,192 @@ void update(int color) {
}
void loop() {
dnsServer.processNextRequest();
server.handleClient();
Serial.print("AP IP address: ");
Serial.println(WiFi.softAPIP());
runner.execute();
}
#define NUM_COLORS 143
int colors[NUM_COLORS] = {
0, // 0x0: reserved
0x000000, // 0x01: black
0xc0c0c0, // 0x02: silver
0x808080, // 0x03: gray / grey
0xffffff, // 0x04: white
0x800000, // 0x05: maroon
0xff0000, // 0x06: red
0x800080, // 0x07: purple
0xff00ff, // 0x08: fuchsia
0x008000, // 0x09: green
0x00ff00, // 0x0a: lime
0x808000, // 0x0b: olive
0xffff00, // 0x0c: yellow
0x000080, // 0x0d: navy
0x0000ff, // 0x0e: blue
0x008080, // 0x0f: teal
0x00ffff, // 0x10: aqua
0xffa500, // 0x11: orange
0xf0f8ff, // 0x12: aliceblue
0xfaebd7, // 0x13: antiquewhite
0x7fffd4, // 0x14: aquamarine
0xf0ffff, // 0x15: azure
0xf5f5dc, // 0x16: beige
0xffe4c4, // 0x17: bisque
0xffebcd, // 0x18: blanchedalmond
0x8a2be2, // 0x19: blueviolet
0xa52a2a, // 0x1a: brown
0xdeb887, // 0x1b: burlywood
0x5f9ea0, // 0x1c: cadetblue
0x7fff00, // 0x1d: chartreuse
0xd2691e, // 0x1e: chocolate
0xff7f50, // 0x1f: coral
0x6495ed, // 0x20: cornflowerblue
0xfff8dc, // 0x21: cornsilk
0xdc143c, // 0x22: crimson
0x00ffff, // 0x23: cyan / aqua
0x00008b, // 0x24: darkblue
0x008b8b, // 0x25: darkcyan
0xb8860b, // 0x26: darkgoldenrod
0xa9a9a9, // 0x27: darkgray / darkgrey
0x006400, // 0x28: darkgreen
0xbdb76b, // 0x29: darkkhaki
0x8b008b, // 0x2a: darkmagenta
0x556b2f, // 0x2b: darkolivegreen
0xff8c00, // 0x2c: darkorange
0x9932cc, // 0x2d: darkorchid
0x8b0000, // 0x2e: darkred
0xe9967a, // 0x2f: darksalmon
0x8fbc8f, // 0x30: darkseagreen
0x483d8b, // 0x31: darkslateblue
0x2f4f4f, // 0x32: darkslategray / darkslategrey
0x00ced1, // 0x33: darkturquoise
0x9400d3, // 0x34: darkviolet
0xff1493, // 0x35: deeppink
0x00bfff, // 0x36: deepskyblue
0x696969, // 0x37: dimgray / dimgrey
0x1e90ff, // 0x38: dodgerblue
0xb22222, // 0x39: firebrick
0xfffaf0, // 0x3a: floralwhite
0x228b22, // 0x3b: forestgreen
0xdcdcdc, // 0x3c: gainsboro
0xf8f8ff, // 0x3d: ghostwhite
0xffd700, // 0x3e: gold
0xdaa520, // 0x3f: goldenrod
0xadff2f, // 0x40: greenyellow
0x808080, // 0x41: grey
0xf0fff0, // 0x42: honeydew
0xff69b4, // 0x43: hotpink
0xcd5c5c, // 0x44: indianred
0x4b0082, // 0x45: indigo
0xfffff0, // 0x46: ivory
0xf0e68c, // 0x47: khaki
0xe6e6fa, // 0x48: lavender
0xfff0f5, // 0x49: lavenderblush
0x7cfc00, // 0x4a: lawngreen
0xfffacd, // 0x4b: lemonchiffon
0xadd8e6, // 0x4c: lightblue
0xf08080, // 0x4d: lightcoral
0xe0ffff, // 0x4e: lightcyan
0xfafad2, // 0x4f: lightgoldenrodyellow
0xd3d3d3, // 0x50: lightgray / lightgrey
0x90ee90, // 0x51: lightgreen
0xffb6c1, // 0x52: lightpink
0xffa07a, // 0x53: lightsalmon
0x20b2aa, // 0x54: lightseagreen
0x87cefa, // 0x55: lightskyblue
0x778899, // 0x56: lightslategray / lightslategrey
0xb0c4de, // 0x57: lightsteelblue
0xffffe0, // 0x58: lightyellow
0x32cd32, // 0x59: limegreen
0xfaf0e6, // 0x5a: linen
0xff00ff, // 0x5b: magenta / fuchsia
0x66cdaa, // 0x5c: mediumaquamarine
0x0000cd, // 0x5d: mediumblue
0xba55d3, // 0x5e: mediumorchid
0x9370db, // 0x5f: mediumpurple
0x3cb371, // 0x60: mediumseagreen
0x7b68ee, // 0x61: mediumslateblue
0x00fa9a, // 0x62: mediumspringgreen
0x48d1cc, // 0x63: mediumturquoise
0xc71585, // 0x64: mediumvioletred
0x191970, // 0x65: midnightblue
0xf5fffa, // 0x66: mintcream
0xffe4e1, // 0x67: mistyrose
0xffe4b5, // 0x68: moccasin
0xffdead, // 0x69: navajowhite
0xfdf5e6, // 0x6a: oldlace
0x6b8e23, // 0x6b: olivedrab
0xff4500, // 0x6c: orangered
0xda70d6, // 0x6d: orchid
0xeee8aa, // 0x6e: palegoldenrod
0x98fb98, // 0x6f: palegreen
0xafeeee, // 0x70: paleturquoise
0xdb7093, // 0x71: palevioletred
0xffefd5, // 0x72: papayawhip
0xffdab9, // 0x73: peachpuff
0xcd853f, // 0x74: peru
0xffc0cb, // 0x75: pink
0xdda0dd, // 0x76: plum
0xb0e0e6, // 0x77: powderblue
0xbc8f8f, // 0x78: rosybrown
0x4169e1, // 0x79: royalblue
0x8b4513, // 0x7a: saddlebrown
0xfa8072, // 0x7b: salmon
0xf4a460, // 0x7c: sandybrown
0x2e8b57, // 0x7d: seagreen
0xfff5ee, // 0x7e: seashell
0xa0522d, // 0x7f: sienna
0x87ceeb, // 0x80: skyblue
0x6a5acd, // 0x81: slateblue
0x708090, // 0x82: slategray / slategrey
0xfffafa, // 0x83: snow
0x00ff7f, // 0x84: springgreen
0x4682b4, // 0x85: steelblue
0xd2b48c, // 0x86: tan
0xd8bfd8, // 0x87: thistle
0xff6347, // 0x88: tomato
0x40e0d0, // 0x89: turquoise
0xee82ee, // 0x8a: violet
0xf5deb3, // 0x8b: wheat
0xf5f5f5, // 0x8c: whitesmoke
0x9acd32, // 0x8d: yellowgreen
0x663399, // 0x8e: rebeccapurple
};
void t1Callback() {
if (state) {
state = false;
if (code.length() == 0) {
update(0);
t1.delay(dit);
} else {
char current = code.charAt(pos);
pos = (pos + 1) % code.length();
if (current == '.') {
state = true;
update(0xFFFFFF);
t1.delay(dit);
} else if (current == '-') {
state = true;
update(0xFFFFFF);
t1.delay(dah);
} else {
t1.delay(dah);
}
return;
}
}
void serveIndex(){
server.send(200, "text/html", FPSTR(html_index));
sendProgmem(&server,html_index);
}
void handleOther(){
String message = "File Not Found\n\n";
message += "URI: ";
message += server.uri();
message += "\nMethod: ";
message += (server.method() == HTTP_GET) ? "GET" : "POST";
message += "\nArguments: ";
message += server.args();
message += "\n";
for (uint8_t i = 0; i < server.args(); i++) {
message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
int c = (int) code.charAt(pos);
if (c >= NUM_COLORS) {
c = 0;
}
server.send(404, "text/plain", message);
int color = colors[c];
update(color);
pos = (pos + 1) % code.length();
int delay = code.charAt(pos) * 10;
t1.delay(delay);
pos = (pos + 1) % code.length();
}
void handleSet(){
int red = -1;
int green = -1;
int blue = -1;
for (uint8_t i=0; i < server.args(); i++) {
if (server.argName(i) == "red") {
red = atoi(server.arg(i).c_str());
} else if (server.argName(i) == "green") {
green = atoi(server.arg(i).c_str());
} else if (server.argName(i) == "blue") {
blue = atoi(server.arg(i).c_str());
void serveIndex() {
for (int i = 0; i < server.args(); i++) {
if (server.argName(i) == "code") {
String base64 = server.arg(i);
int decodedLength = Base64.decodedLength((char *) base64.c_str(), base64.length());
char decodedString[decodedLength];
Base64.decode(decodedString, (char *) base64.c_str(), base64.length());
code = String(decodedString);
char data[EEPROM_SIZE];
strcpy(data, code.c_str());
EEPROM.put(0, data);
EEPROM.commit();
pos = 0;
}
}
if (red > -1 && blue > -1 && green > -1) {
update(red + (green << 8) + (blue << 16));
}
server.send(200, "text/plain", "OK");
server.send(200, "text/html", FPSTR(html_index));
sendProgmem(&server, html_index);
}
// 'a': Ausgabe('.-');
// 'b': Ausgabe('-...');
// 'c': Ausgabe('-.-.');
// 'd': Ausgabe('-..');
// 'e': Ausgabe('.');
// 'f': Ausgabe('..-.');
// 'g': Ausgabe('--.');
// 'h': Ausgabe('....');
// 'i': Ausgabe('..');
// 'j': Ausgabe('.---');
// 'k': Ausgabe('-.-');
// 'l': Ausgabe('.-..');
// 'm': Ausgabe('--');
// 'n': Ausgabe('-.');
// 'o': Ausgabe('---');
// 'p': Ausgabe('.--.');
// 'q': Ausgabe('--.-');
// 'r': Ausgabe('.-.');
// 's': Ausgabe('...');
// 't': Ausgabe('-');
// 'u': Ausgabe('..-');
// 'v': Ausgabe('...-');
// 'w': Ausgabe('.--');
// 'x': Ausgabe('-..-');
// 'y': Ausgabe('-.--');
// 'z': Ausgabe('--..');
// '1': Ausgabe('.----');
// '2': Ausgabe('..---');
// '3': Ausgabe('...--');
// '4': Ausgabe('....-');
// '5': Ausgabe('.....');
// '6': Ausgabe('-....');
// '7': Ausgabe('--...');
// '8': Ausgabe('---..');
// '9': Ausgabe('----.');
// '0': Ausgabe('-----');
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment