Hey,
Thanks for the welcome
.
Yeah of course. Sorry i didn't clean up an leftover code and i didn't care about readability too much. I just analog read a pin with nothing attached to it, since i just care about the data being sent succesfully.
I will also send a picture where you need to go on the website to start it.
#include "defines.h"
#include "arduino_secrets.h"
#define TIMER_INTERRUPT_DEBUG 0
#define _TIMERINTERRUPT_LOGLEVEL_ 0
#include "SAMDTimerInterrupt.h"
SAMDTimer ITimer(TIMER_TC3);
// WLAN DATEN
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
int keyIndex = 0; // nur für WEP
int status= WL_IDLE_STATUS;
// Variablen zum erzeugen zufaeliiger Werte
int messungaktiv=0;
int svg_zaehler = 0;
int svg_interrupt_zaehler = 0;
unsigned long i=0;
unsigned long k=0;
unsigned long w=0;
unsigned long h=0;
unsigned long d=0;
unsigned int x = 0;
unsigned long n=0;
unsigned long m=0;
unsigned long data[110];
unsigned long zeit[110];
unsigned long messung[110];
// Interrrupt Varaiblen
volatile int data_i[1200];
volatile int zeit_i[1200];
volatile int analog_overhead=0;
volatile int ajax_refresh_length=0;
volatile long o=0; //davor = o=1;
volatile long u=0;
volatile int z=0;
volatile long z_k=0;
volatile long y=1;
volatile long a=0;
volatile long zaehler=0;
volatile long dimension=0;
char XML_Buffer[50];
char XML_Content[1500];//2200 // 1500 ^=SVG Number 45
volatile int website_zaehler = 0;
volatile int messung_zaehler = 0;
volatile int messung_zaehler_init = 0;
// Ajax Varaiblen
int Position = 0;
int Auffrischungslaenge = 0;
volatile int Index = 1;
volatile int SVG_durchgaenge = 0;
int xml_zaehler=0;
int zeit_xml;
int data_xml;
int start_button=1;
long size_zeit = 0;
unsigned long size_data = 0;
char SendeBuffer[00];//800
char sender_graph[2250];//2800 //2250 ^=SVG Number 45
const char ekg_img[] PROGMEM = {"Ides"};
//200
const char Javascript_3[] PROGMEM = {"setInterval(function()\n {\n getGraph();\n }, 200);\n function getGraph()\n \n\t{\n if(document.getElementById(\"checkbox\").checked==1) { var GraphvalHttpRequest = new XMLHttpRequest();\n GraphvalHttpRequest.onreadystatechange = function()\n {\n if(this.readyState == 4 && this.status == 200)\n { \n var GraphvalRequest=this.responseXML;\n var i;\n var zeile = GraphvalRequest.getElementsByTagName(\"Z\");\n var index = GraphvalRequest.getElementsByTagName(\"I\")[0].childNodes[0].nodeValue;\n var Position = GraphvalRequest.getElementsByTagName(\"P\")[0].childNodes[0].nodeValue;\n var svg = document.getElementById(\"svg_frame\"); \n var current_svg_id= \"svg_graph_\" + index;\n var current_svg = svg.contentDocument.getElementById(current_svg_id).contentDocument; \n for (i = 0; i<zeile.length-2; i++){ var linie_graph = +Position + +i;\n var momentane_linie=current_svg.getElementById(linie_graph);\n var linie_element = current_svg.createElementNS('http://www.w3.org/2000/svg', 'line'); linie_element.setAttribute(\"id\" ,linie_graph);\n linie_element.setAttribute(\"x1\" ,zeile[i].getElementsByTagName(\"z\")[0].childNodes[0].nodeValue);linie_element.setAttribute(\"y1\",zeile[i].getElementsByTagName(\"d\")[0].childNodes[0].nodeValue);\n linie_element.setAttribute(\"x2\",zeile[i+1].getElementsByTagName(\"z\")[0].childNodes[0].nodeValue);linie_element.setAttribute(\"y2\",zeile[i+1].getElementsByTagName(\"d\")[0].childNodes[0].nodeValue); \n var parent = current_svg.getElementsByTagName(\"g\")[0]; parent.replaceChild(linie_element,momentane_linie); console.log(current_svg);\n }}};\n GraphvalHttpRequest.open(\"GET\", \"XML_Content.xml\", true);\n GraphvalHttpRequest.send();\n }} "};
//const char index_html[] PROGMEM = {"<!DOCTYPE html><html><head></head><body><h1>Test</h1><p>\"100 mal nachladen wenn es klappt->large html/package porblem\"</p></body></html>"};
const char index_html[] PROGMEM = {"<!DOCTYPE html>\n<html>\n\n<head>\n <title>EKG</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n</head>\n\n<body>\n <header>\n \n <h1>Kabelloses EKG</h1>\n </header>\n\n<section>\n <nav>\n\t\t<div class=\"Auswahlmenue\">\n\t<span class=\"Auswahloben\"><a class=\"active\" href=\"index.html\">Homepage</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Aktuelle_Messung.html\">Daten aktuelle Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Alte_Messung.html\">Auswahl alter Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"App.html\">Alles zur App</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Sonstiges.html\">Sonstiges</a></span>\t\t\n\t</div> \n </nav>\n</section> \n\t\t\n<section>\n\n\t<p> Tabelle 1:</p>\n\t<table class=\"Messung\" border=\"10\" cellpadding=\"5\" cellspacing=\"0\"> \n <tr>\n <th>Season</th>\n <th>Month</th>\n <th>Rent</th>\n <th colspan=\"2\">Utilities</th>\n <th>Groceries</th>\n <th>Eating Out</th>\n <th>Entertainment</th>\n </tr>\n <tr>\n <td rowspan=\"3\">Fall</td>\n <td>June</td>\n <td>€1300</td>\n <td>€100</td>\n <td>€50</td>\n <td>350€</td>\n <td>100€</td>\n <td>€50</td>\n\n </tr>\n\n <tr>\n <td>July</td>\n <td>€1300</td>\n <td>€100</td>\n <td>€50</td>\n <td>350€</td>\n <td>100€</td>\n <td>€50</td>\n\n </tr>\n\n <tr>\n <td>August</td>\n <td>€1300</td>\n <td>€100</td>\n <td>€50</td>\n <td>350€</td>\n <td>100€</td>\n <td>€50</td>\n\n </tr>\n </table>\n </section>\n\n</body>\n\n</html>"};
const char Alte_Messung_html[] PROGMEM = {"<!DOCTYPE html>\n<html>\n\n<head>\n <title>EKG</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n</head>\n\n<body>\n <header>\n \n <h1>Kabelloses EKG</h1>\n </header>\n\n <nav>\n\n<section>\n <nav>\n\t\t<div class=\"Auswahlmenue\">\n\t<span class=\"Auswahloben\"><a href=\"index.html\">Homepage</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Aktuelle_Messung.html\">Daten aktuelle Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a class=\"active\" href=\"Alte_Messung.html\">Auswahl alter Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"App.html\">Alles zur App</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Sonstiges.html\">Sonstiges</a></span>\t\t\n\t</div> \n </nav>\n</section> \n<section>\n<div id=\"body\" </div> <img src=\"img_ekg_theme.jpg\" alt=\"EKG_Project_Theme\" <p>EKG App</p> </body></html>"};
const char Aktuelle_Messung_html[] PROGMEM = {"<!DOCTYPE html>\n<html>\n\n<head>\n <title>EKG</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n</head>\n\n<body>\n\n <header>\n \n <h1>Kabelloses EKG</h1>\n </header>\n\n<section>\n <nav>\n\t\t<div class=\"Auswahlmenue\">\n\t<span class=\"Auswahloben\"><a href=\"index.html\">Homepage</a></span>\t\n\t<span class=\"Auswahloben\"><a class=\"active\" href=\"Aktuelle_Messung.html\">Daten aktuelle Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Alte_Messung.html\">Auswahl alter Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"App.html\">Alles zur App</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Sonstiges.html\">Sonstiges</a></span>\t\t\n\t</div>\n </nav>\n</section> \n\n<div class=\"content\">\n \n<section>\n\t <p><iframe src=\"Test_svg_data.html\" frameborder=\"0\" height=\"400\"\n\t\t\t\t\n width=\"100%\"></iframe></p>\n\t\t\n</section>\n\t\n<section>\t \n\t <p><iframe src=\"Daten.html\" frameborder=\"0\" height=\"200\"\n\t\t\t\t\n width=\"70%\"></iframe></p>\n\t\t\n\n\n</section>\n</div> \n</body>\n\n</html>"};
const char App_html[] PROGMEM = {"<!DOCTYPE html>\n<html>\n\n<head>\n <title>EKG</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n</head>\n\n<body>\n <header>\n \n <h1>Kabelloses EKG</h1>\n </header>\n\n<section>\n <nav>\n\t\t<div class=\"Auswahlmenue\">\n\t<span class=\"Auswahloben\"><a href=\"index.html\">Homepage</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Aktuelle_Messung.html\">Daten aktuelle Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Alte_Messung.html\">Auswahl alter Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a class=\"active\" href=\"App.html\">Alles zur App</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Sonstiges.html\">Sonstiges</a></span>\t\t\n\t</div> \n </nav>\n</section> \n \n<section>\n"};
const char Sonstiges_html[] PROGMEM = {"<!DOCTYPE html>\n<html>\n\n<head>\n <title>EKG</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">\n</head>\n\n<body>\n <header>\n \n <h1>Kabelloses EKG</h1>\n </header>\n\n<section>\n <nav>\n\t\t<div class=\"Auswahlmenue\">\n\t<span class=\"Auswahloben\"><a href=\"index.html\">Homepage</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Aktuelle_Messung.html\">Daten aktuelle Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Alte_Messung.html\">Auswahl alter Messung</a></span>\t\n\t<span class=\"Auswahloben\"><a class=\"active\" href=\"App.html\">Alles zur App</a></span>\t\n\t<span class=\"Auswahloben\"><a href=\"Sonstiges.html\">Sonstiges</a></span>\t\t\n\t</div> \n </nav>\n</section> <div class=\"content\"> <input type=\"checkbox\" id=\"checkbox\"> \n <section>\n\t <p><iframe src=\"Test_svg_data.html\" id=\"svg_frame\" frameborder=\"0\" height=\"400\"\n\t\t\t\t\n width=\"100%\"></iframe></p>\n\n</section>\n \n<section>\n <script src=\"ajax_script.js\" > </script></div> </body> </html>"};
const char style_css[] PROGMEM = {"\nbody {\n\tfont-family: Helvetica, Arial, sans-serif;\n\t\n\tbackground-color: indianred;\n\t\n\tcolor: #320b50;\n\t\n\tfont-size: 30px;\n\tline-height: 42px;\n\tmargin: 40px 0;\n}\n\nbody::before {\n\tposition: fixed;\n\tcontent: \"\";\n\theight: 400px;\n\twidth: 400px;\n\ttop: 20px;\n\tright: 30px;\n\topacity: 0.2;\n}\n\nh1,h2,h3,h4,h5,h6 {\n\tfont-family: 'Verdana', cursive;\n}\n\nh1 {\n\twidth: 60%;\n\tmax-width: 960px;\n\tmargin: 0 auto 60px;\n\ttransform: rotate(-0deg);\n\tcolor: white;\n\ttext-align: left;\n\tfont-size: 5rem;\n\tline-height: 5rem;\n\ttext-shadow: 0 1px 0 hsl(52,7%,20%),\n 0 2px 0 hsl(52,7%,18%),\n 0 3px 0 hsl(52,7%,16%),\n 0 4px 0 hsl(52,7%,14%),\n 0 5px 0 hsl(52,7%,12%),\n 0 6px 0 hsl(52,7%,10%),\n 0 7px 0 hsl(52,7%,8%),\n 0 8px 0 hsl(52,7%,6%),\n 0 0 5px rgba(0,0,0,.05),\n 0 1px 3px rgba(0,0,0,.2),\n 0 3px 5px rgba(0,0,0,.2),\n 0 5px 10px rgba(0,0,0,.2),\n 0 10px 10px rgba(0,0,0,.2),\n 0 20px 20px rgba(0,0,0,.3);\n}\n\t\nh2\t{\n\tcolor: white;\n}\n \t\nsection {\n position: relative;\n border-top: solid 1px #aaa;\n border-bottom: solid 1px #444;\n padding:25px 0;\n}\n\n section:first-child::before {\n position: absolute;\n content: \"\";\n width: 100%;\n height: 1px;\n border-top: solid 1px #444;\n top: -2px;\n left: 0;\n }\n\n section:last-child::after {\n position: absolute;\n content: \"\";\n width: 100%;\n border-top: solid 1px #bbb;\n bottom: -2px;\n left: 0;\n }\n\n.Messung {\n\tdisplay: inline-block;\n\tlist-style: none;\n\tmargin: 0 2% 0 0;\n\tpadding: 0;\n\t\n}\n\n.content {\n\tposition: relative;\n\tbackground: #e7eef1;\n\twidth: 80%;\n\tmax-width: 1080px;\n\tmargin: 60px auto;\n\tpadding: 40px 40px 60px;\n\tbox-sizing: border-box;\n\tborder-radius: 2px;\n\tbox-shadow: 0 12px 0 -6px #AD5C5C;\t\n}\n.content::before {\n\tposition: absolute;\n\tdisplay: block;\n\tcontent: \"\";\n\tborder: solid 6px transparent;\n\tborder-right: solid 6px #AD5C5C;\n\tborder-top-width: 0px;\n background: none;\n bottom: -6px;\n\tleft: -6px;\n}\n\n .content::after {\n position: absolute;\n display: block;\n content: \"\";\n border: solid 6px transparent;\n border-top: solid 6px #AD5C5C;\n border-bottom-width: 0px;\n background: none;\n right: 0;\n bottom: -6px;\n }\n\n\na {\n\ttext-decoration: none;\n}\n\n.Auswahlmenue{\n\tbackground-color: #d13d4d;\n\theight: 30%\n}\n\n.Auswahloben input { \n opacity: 0;\n width: 0;\n height: 0;\n}\n\n.Auswahloben {\n\tposition: relative;\n\tdisplay: inline-block;\n\tmargin-left: -6px;\n\tz-index: 2;\n\tcolor: white;\n\tvertical-align: top;\n\tcontent: \"Homepage\";\n\tfont-size: 20px;\n\tline-height: 35px;\n\ttext-align: top;\n\tbackground-color: #d13d4d;\n\ttext-shadow: 0 1px 0 #3359a5;\n\twidth: 18%;\n\theight: 200px;\n\tborder: solid 1px #351111;\n\tborder-top: solid 1px transparent;\n\tborder-bottom: solid 1px transparent;\n\ttext-decoration: none;\n\n}\n\n.Auswahloben:first-child {\n\tmargin-left: 0px;\n}\n\n.Auswahloben:hover {\n\tbackground-color: #8e236b;\n}\n\n.Auswahloben:target {\n\tcolor: red;\n}\n\ninput:checked {\n\tbackground-color: blue;\n}\n\n\n\n.table{\n\tdisplay: inline-block;\n\tlist-style: none;\n\tmargin: 0 2% 0 0;\n\tpadding: 0;\n}\n\n\n"};
const char Test_svg_data_html[] PROGMEM = {" \n<html>\n<head>\n\n \n \n\n</head>\n<style>\n #row {\n\tposition: relative;\n\tdisplay: border-box;\n}\n\n.column {\n\tposition: absolute;\n float: left;\n\twidth: 25%;\n}\n\n#row img{\n\tposition: relative;\n}\t\n</style>\n<body>\n\t<div id=\"row\">\n <div class=\"column\">\n <object data=\"linie1.svg\" id=\"svg_graph_1\" type=\"image/svg+xml\"></object>\n </div>\n <div class=\"column\">\n <object data=\"linie2.svg\" id=\"svg_graph_2\" type=\"image/svg+xml\"></object>\n </div>\n <div class=\"column\">\n <object data=\"linie3.svg\" id=\"svg_graph_3\" type=\"image/svg+xml\"></object>\n</div>\n<div class=\"column\">\n <object data=\"linie4.svg\" id=\"svg_graph_4\" type=\"image/svg+xml\"></object>\n</div>\n\t\t<div class=\"column\">\n <object data=\"linie5.svg\" id=\"svg_graph_5\" type=\"image/svg+xml\"></object>\n</div>\n</div>\n</body>\n</html>\n"}; const char Test_ajax_data_html[] PROGMEM = {"\n<!DOCTYPE html>\n<html>\n\n<head>\n\n</head>\n\t<body>\n<wrapper><text id=\"linie_0\"> </text>\n<text id=\"linie_1\"> </text>\n<text id=\"linie_2\"> </text>\n<text id=\"linie_3\"> </text>\n<text id=\"linie_4\"> </text>\n<text id=\"linie_5\"> </text>\n<text id=\"linie_6\"> </text>\n<text id=\"linie_7\"> </text>\n<text id=\"linie_8\"> </text>\n<text id=\"linie_9\"> </text> \n<text id=\"linie_10\"> Hallo</text>\n<text id=\"linie_11\"> </text>\n<text id=\"linie_12\"> </text>\n<text id=\"linie_13\"> </text>\n<text id=\"linie_14\"> </text>\n<text id=\"linie_15\"> </text>\n<text id=\"linie_16\"> </text>\n<text id=\"linie_17\"> </text>\n<text id=\"linie_18\"> </text>\n<text id=\"linie_19\"> </text>\n<text id=\"linie_20\"> </text>\n<text id=\"linie_21\"> </text>\n<text id=\"linie_22\"> </text>\n<text id=\"linie_23\"> </text>\n<text id=\"linie_24\"> </text>\n<text id=\"linie_25\"> </text>\n<text id=\"linie_26\"> </text>\n<text id=\"linie_27\"> </text>\n<text id=\"linie_28\"> </text>\n<text id=\"linie_29\"> </text>\n<text id=\"linie_30\"> </text>\n<text id=\"linie_31\"> </text>\n<text id=\"linie_32\"> </text>\n<text id=\"linie_33\"> </text>\n<text id=\"linie_34\"> </text>\n<text id=\"linie_35\"> </text>\n<text id=\"linie_36\"> </text>\n<text id=\"linie_37\"> </text>\n<text id=\"linie_38\"> </text>\n<text id=\"linie_39\"> </text>\n<text id=\"linie_40\"> </text>\n<text id=\"linie_41\"> </text>\n<text id=\"linie_42\"> </text>\n<text id=\"linie_43\"> </text>\n<text id=\"linie_44\"> </text>\n<text id=\"linie_45\"> </text>\n<text id=\"linie_46\"> </text>\n<text id=\"linie_47\"> </text>\n<text id=\"linie_48\"> </text>\n<text id=\"linie_49\"> </text>\n<text id=\"linie_50\"> </text>\n </wrapper></body> \n </html> /n"};
#define HW_TIMER_INTERVAL_MS 5L //5
//35
#define SVG_length 45
#define SVG_number 5
#define analog_buffer 4
WiFiWebServer server(80);
void AD_Wandlung_Simulation(void)
{
//Serial.print("Interrupts aufgerufen");
if(z>=SVG_length*analog_buffer*SVG_number+2&&analog_overhead<=SVG_durchgaenge*SVG_length){
data_i[analog_overhead]=analogRead(A0);
zeit_i[analog_overhead]= analog_overhead;
analog_overhead++;
website_zaehler++;
}
if(o==1) {
messung_zaehler_init=1;
data_i[z] = analogRead(A0);
zeit_i[z] = z;
/*if (z==10) {
Serial.println("Simulation_Test");
Serial.println(data_i[0]);
Serial.println(data_i[1]);
Serial.println(data_i[2]);
Serial.println(data_i[3]);
Serial.println(data_i[4]);
Serial.println(data_i[5]);
Serial.println(data_i[6]);
Serial.println(data_i[7]);
Serial.println(data_i[8]);
Serial.println(data_i[9]);
}*/
website_zaehler++;
z++;
if (z>=SVG_length*analog_buffer*SVG_number+2) {
o=0;
}
}
if(messung_zaehler_init==1)
messung_zaehler++;
if(z>=SVG_length*analog_buffer*SVG_number+2&&o==2){
// z=analog_overhead;
//analog_overhead=0;
//o=1;
z=analog_overhead;
analog_overhead=0;
o=1;
/*Serial.println("Zumindest wurde der reset von z_Array aufgerufen");*/
}
}
void zahlenraushauen(){
n= millis();
char data_buffer[70];
char loeschen[] = "";
long t=0;
n= millis();
for (i=0; i < 10; i++) {
for (k=0; k<10; k++) {
w= i + random(3,6);
d= -0.5*k + random(3,6);
h = w + d + random(3,6);
delay(1);
m= millis();
t= m-n;
data[i*10+k] = h;
zeit[i*10+k] = t;
messung[i*10+k] = i*10+k;
}
}
}
void handleTabelle () {
char loeschen[] = "";
char auswaehlbuffer[3];
unsigned long ze;
unsigned long da;
unsigned long me;
/*Tabellenvaraiblen*/
char t_header[] PROGMEM = "<table class=\"Aktuelle_Messung\"> <tr> <th>Messung</th> <th>Zeit seit Messbeginn</th> <th>Ergebniss</th> </tr>";
char t_ende[] PROGMEM = "</table>";
char t_zstart[] PROGMEM = "<tr> ";
char t_sstart[] PROGMEM = "<td>";
char t_sende[] PROGMEM = "</td>";
char t_zende[] PROGMEM = "</tr>";
strcpy(auswaehlbuffer,loeschen);
Serial.println("Aufgerufen");
strcat(SendeBuffer,t_header);
for (int f=0; f<10; f += 1) {
strcat(SendeBuffer, t_zstart );
strcat(SendeBuffer, t_sstart );
me = messung[f];
sprintf(auswaehlbuffer,"%lu",me);
strcat(SendeBuffer, auswaehlbuffer );
strcpy(auswaehlbuffer,loeschen);
strcat(SendeBuffer, t_sende );
strcat(SendeBuffer, t_sstart );
ze = zeit[f];
sprintf(auswaehlbuffer,"%lu",ze);
strcat(SendeBuffer, auswaehlbuffer );
strcpy(auswaehlbuffer,loeschen);
strcat(SendeBuffer, t_sende );
strcat(SendeBuffer, t_sstart );
da = data[f];
sprintf(auswaehlbuffer,"%lu",da);
strcat(SendeBuffer, auswaehlbuffer );
strcpy(auswaehlbuffer,loeschen);
strcat(SendeBuffer, t_sende );
strcat(SendeBuffer, t_zende );
}
Serial.println("1.Station");
strcat(SendeBuffer, t_ende );
Serial.println("2.Station");
}
void handleGraph1() {
svg_zaehler=0;
handleGraph();
}
void handleGraph2() {
svg_zaehler=1;
handleGraph();
}
void handleGraph3() {
svg_zaehler=2;
handleGraph();
}
void handleGraph4() {
svg_zaehler=3;
handleGraph();
}
void handleGraph5() {
svg_zaehler=4;
handleGraph();
}
void handleGraph() {
Serial.println("Graph Aufgerufen");
messung_zaehler_init = 0;
website_zaehler = 0;
messung_zaehler = 0;
//*char svg_start[] PROGMEM = "<svg width=\"1800\" height=\"200\">\n <rect width=\"1800\" height=\"200\" style=\"fill:rgb(244,244,244);stroke-width:3;stroke:rgb(0,0,0)\" /> <g stroke=\"blue\">";*//
char svg_start[200];
String graph;
unsigned long datenlaenge = i*10+k;
int unteres_Limit =svg_zaehler*SVG_length;
int oberes_Limit = svg_zaehler*SVG_length+SVG_length;
unsigned long weite = 1200;
sprintf(svg_start,"<svg xmlns=\"http://www.w3.org/2000/svg\" id=\"svg_%d\" version=\"1.1\" width=\"%lu\" height=\"1300\"> <g stroke=\"blue\" stroke-width=\"1\" >\n",svg_zaehler,weite);
char g_ende[] PROGMEM = "</g>";
char svg_ende[] PROGMEM = "</svg>";
int x1;
int x2;
int y1;
int y2;
int x1_0=0;
int x2_0=0;
int y1_0=0;
int y2_0=0;
char buffer_graph[100];
char loeschen[] = "";
strcpy(buffer_graph,loeschen);
strcpy(sender_graph,loeschen);
strcat(sender_graph,svg_start);
y1= data_i[unteres_Limit-1];
x1= zeit_i[unteres_Limit-1];
if(svg_zaehler==0) {
y1=data_i[0];
x1=zeit_i[0];
}
Serial.println("Programmstart");
for (int f=unteres_Limit; f<=oberes_Limit; f += 1) {
y2= data_i[f];
x2= zeit_i[f];
sprintf(buffer_graph,"<line id=\"%d\" x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" />\n", f-unteres_Limit, x1_0, y1_0, x2_0, y2_0);
y1= y2;
x1= x2;
strcat(sender_graph,buffer_graph);
}
Serial.println("Buffer ausgefüllt");
strcat(sender_graph,g_ende);
strcat(sender_graph,svg_ende);
Serial.println("Sender fertig ausgefüllt ausgefüllt");
//Serial.println(sender_graph);
server.send(200,"image/svg+xml",sender_graph);
if(svg_interrupt_zaehler==3) {
o=2; }
svg_zaehler++;
Serial.println("Sender fertig geschickt");
strcpy(sender_graph,loeschen);
}
void handleXMLcontent(){
if(start_button==1){
o=1;
start_button=0;
}
char loeschen[] = "";
strcpy(XML_Content,loeschen);
strcpy(XML_Buffer,loeschen);
Position=(Position+Auffrischungslaenge);
if(Position>=SVG_length) {
Position=0;
Index++;
}
if (Index>=SVG_number+1) {
Index=1;
}
Auffrischungslaenge = z-Position-SVG_length*SVG_durchgaenge-1;
if (Auffrischungslaenge<0) {
Auffrischungslaenge = 0;
}
if((Position+Auffrischungslaenge)>=SVG_length){
Auffrischungslaenge= SVG_length-Position;
}
const char XML_0[] PROGMEM="<?xml version=\"1.0\" encoding=\"UTF-8\"?><w><I>";
strcat(XML_Content,XML_0);
sprintf(XML_Buffer,"%d",Index);
strcat(XML_Content,XML_Buffer);
const char XML_1[] PROGMEM="</I><P>";
strcat(XML_Content,XML_1);
sprintf(XML_Buffer,"%d",Position);
strcat(XML_Content,XML_Buffer);
const char XML_2[] PROGMEM="</P><A>";
strcat(XML_Content,XML_2);
sprintf(XML_Buffer,"%d",Auffrischungslaenge);
strcat(XML_Content,XML_Buffer);
const char XML_3[] PROGMEM="</A><S>";
strcat(XML_Content,XML_3);
sprintf(XML_Buffer,"%d",SVG_length);
strcat(XML_Content,XML_Buffer);
const char XML_4[] PROGMEM="</S>";
strcat(XML_Content,XML_4);
Serial.println("z Werten");
Serial.println(z);
Serial.println("analog_overhead Werten");
Serial.println(analog_overhead);
Serial.println("Website mit fespeicherten Werten");
Serial.println(website_zaehler);
Serial.println("Interrupt Ticker Zähler");
Serial.println(messung_zaehler);
for(xml_zaehler=SVG_durchgaenge*SVG_length+Position;xml_zaehler<=SVG_durchgaenge*SVG_length+Auffrischungslaenge+1+Position;xml_zaehler++) {
data_xml=data_i[xml_zaehler];
zeit_xml=zeit_i[xml_zaehler];
sprintf(XML_Buffer,"<Z><d>%lu</d><z>%lu</z></Z>\n",data_xml,zeit_xml);
strcat(XML_Content,XML_Buffer);
}
const char XML_5[] PROGMEM="</w>";
strcat(XML_Content,XML_5);
server.send(200,"text/xml",XML_Content);
Serial.println("S");
if (Position+Auffrischungslaenge>=SVG_length) {
SVG_durchgaenge++;
Serial.println("Svg.durchgaenge:");
Serial.println(SVG_durchgaenge);
if (SVG_durchgaenge>=SVG_number*analog_buffer) {
SVG_durchgaenge=0;
o=2;
}
}
}
void handleXMLcontent_website(){
server.send(200,"text/html",Test_ajax_data_html);
}
void handleRoot() {
Serial.println("Index_html");
server.send_P(200,"text/html",index_html);
}
void handleCss() {
Serial.println("Style_Css");
server.send_P ( 200, "text/css", style_css);
}
void handleAktuell() {
Serial.println("Aktuell_html");
server.send_P(200,"text/html",Aktuelle_Messung_html);
}
void handleAlte() {
server.send_P(200,"text/html",Alte_Messung_html);
}
void handleApp() {
Serial.println("App_html");
server.send_P(200,"text/html",App_html);
}
void handleSonstiges() {
Serial.println("Sonstiges_html");
server.send_P(200,"text/html",Sonstiges_html);
}
void handleEKG_image() {
Serial.println("handleEKG_image Aufgerufen");
server.send_P(200,"image/jpg",ekg_img,sizeof(ekg_img));
Serial.println("EKG_image Gesendet");
}
void handleTest_svg_data() {
server.send_P(200,"text/html",Test_svg_data_html);
}
void handleAjaxDaten() {
server.send_P(200,"text/html",Test_ajax_data_html);
Serial.println("handleAjaxDaten Aufgerufen");
}
void handleAjaxScript() {
server.send_P(200,"text/javascript",Javascript_3);
Serial.println("handleAjaxScript Aufgerufen");
}
void handleDaten() {
char loeschen[] = "";
/*HTML Aktuelle Daten --> Aktuelle Daten*/
char Anfang PROGMEM[] ="<!DOCTYPE html>\n\n<html>\n<head>\n</head>\n<body>\n<h2>Aktuelle Daten</h2>\n";
char Ende PROGMEM[] = "</body>\n</html>";
strcpy(SendeBuffer,loeschen);
strcat(SendeBuffer,Anfang);
handleTabelle();
Serial.println("3.Station");
strcat(SendeBuffer,Ende);
Serial.println("4.Station");
Serial.print(SendeBuffer);
Serial.println("5.Station");
server.send(200,"text/html",SendeBuffer);
Serial.println("6.Station");
}
void handleNotFound(){
String message = "File Not Found\n\n";
server.send(404, "text/plain", message);
}
void printWifiStatus() {
// print the SSID of the network you're attached to:
Serial.print("You are connected:");
Serial.println("");
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your board's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
}
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// attempt to connect to Wifi network:
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
status = WiFi.begin(ssid, pass);
Serial.println(ssid);
printWifiStatus();
delay(1000);
}
zahlenraushauen();
server.on("/", handleRoot);
server.on("/style.css", handleCss);
server.on("/index.html", handleRoot);
server.on("/Aktuelle_Messung.html", handleAktuell);
server.on("/Alte_Messung.html", handleAlte);
server.on("/App.html", handleApp);
server.on("/Sonstiges.html", handleSonstiges);
server.on("/Daten.html", handleDaten);
server.on("/Test_svg_data.html", handleTest_svg_data);
server.on("/linie1.svg", handleGraph1);
server.on("/linie2.svg", handleGraph2);
server.on("/linie3.svg", handleGraph3);
server.on("/linie4.svg", handleGraph4);
server.on("/linie5.svg", handleGraph5);
server.on("/XML_Content.xml", handleXMLcontent);
server.on("/Test_ajax_data.html", handleAjaxDaten);
server.on("/ajax_script.js", handleAjaxScript);
server.on("/Html.html", handleXMLcontent_website);
server.on("/img_ekg_theme.jpg", handleEKG_image);
server.onNotFound(handleNotFound);
server.begin();
Serial.println("HTTP server started");
ITimer.attachInterruptInterval(HW_TIMER_INTERVAL_MS * 1000, AD_Wandlung_Simulation);
}
void loop() {
server.handleClient();
}
You have to go to Sonstiges.html and click the button.
Thanks for answering btw.