AVR -IO Ausgabe Problem

Gast #1622422
Lesenswert?

Hallo an alle

Bin mit dem AVR-IO zugange
Dank Hilfe vom Chris habe ich alles am laufen ,auch mit dynamischen 
Variablen.
Grund Source ist von AVR-NETIO_RoBue

Die Daten werden angezeigt und aktuallisiert.

Es wird ein dicker Punkt ausgegeben und dahinter der Wert und "KG WAAGE"
Das ganze Zeile für Zeile.

Mit dem Skript komme ich nicht klar.
Wie kann ich die Ausgabe formatieren und einzelne Werte ausgeben?
Ähnlich write(x,y,%wert);
Es ist anscheinend eine Listen ausgabe in Java ???



PROGMEM char Page2[] = {

  "{\"analog\":["
    "%VA@01,"
    "%VA@02,"
    "%VA@03,"
    "%VA@04,"
    "%VA@05,"
    "%VA@06,"
    "%VA@07,"
    "%VA@08,"
    "%VA@09,"
    "%VA@10"
  "],\"temp\":["
  "],\"time\":"
  "\"%TIME\""
  "}"
  "%END"
};




PROGMEM char Page1[] = {
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" 
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
"<html xmlns=\"http://www.w3.org/1999/xhtml\"; 
xml:lang=\"de\"><head><meta http-equiv=\"Content-Type\" 
content=\"text/html; "
"charset=utf-8\" /><title>My AVR does json!</title><script 
type=\"text/javascript\">HTTPRequest=function(){};HTTPRequest."
"prototype={isSupported:function(){return!!this.getConnection()},events: 
[\"start\",\"open\",\"send\",\"load\",\"end\"],filter:"
"encodeURIComponent,getConnection:function(){var i,o=[function(){return 
new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return"
" new ActiveXObject(\"Microsoft.XMLHTTP\")},function(){return new 
XMLHttpRequest()}];for(i=o.length;i--;){try{return o[i]()}catch(e)"
"{}}return null},formatParams:function(a){var i,r=[];for(i in 
a){r[r.length]=i+\"=\"+(this.filter?this.filter(a[i]):a[i])}return r."
"join(\"&\")},get:function(a,b,c,d){return 
this.request(\"GET\",a,null,c,null,d)},post:function(a,b,c,d){return 
this.request(\"POST\""
",a,b=this.formatParams(b),c,{\"Connection\":\"close\",\"Content-Length\ 
":b.length,\"Method\":\"POST  \"+a+\" HTTP/1.1\",\"Content-Type\""
":\"application/x-www-form-urlencoded; 
charset=utf-8\"},d)},request:function(a,b,c,d,g,h){var 
i,o=this.getConnection(),f=d instanceof"
" Function;try{o.open(a,b,!h);h||(o.onreadystatechange=function(){var 
s=HTTPRequest.prototype.events[o.readyState];f?d(o):s in d&&d[s]"
"(o)});if(g){for(i in{USER_AGENT:0,XUSER_AGENT:0}){i in 
g||(g[i]=\"XMLHttpRequest\")}for(i in 
g){o.setRequestHeader(i,g[i])}}o.send(c);"
"h&&(f?d(o,oThis):d[\"end\"]&&d[\"end\"](o,oThis));return 
true}catch(e){return false}}};var d=document,gebi=function(e){return "
"d.getElementById(e);},gebt=function(e){return 
d.getElementsByTagName(e)};running=false;window.onload=function(){list=[ 
addul(),"
"addul()];tmr=window.setInterval(\"refresh()\",500);};"
"function putdata(){putlist(list[0],data.analog,\"  KG Waage\");"
"putlist(list[1],data.temp,\"°C\");"
"}function 
putlist(a,e,f){if(f===undefined){f=\"\"}while(a.firstChild!==null){a.rem 
oveChild(a.firstChild)}for(var  i=0;i<e.length;i++)"
"{var 
b=d.createElement(\"li\"),c=d.createTextNode(e[i]+f);b.appendChild(c);a. 
appendChild(b)}}function  addul(){a=gebt(\"body\")[0];"
"return a.appendChild(d.createElement(\"ul\"))}function 
refresh(){if(running===false){running=true;var a=new 
HTTPRequest();a.filter="
"escape;a.get(\"data.json\",null,{end:function(e){data=eval(\"(\"+e.resp 
onseText+\")\");putdata();running=false}})}}</script></head>"
"<body></body></html>"
"%END"
};

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren