Add [16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD] prj
This commit is contained in:
43
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ain.htm
Normal file
43
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ain.htm
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>W5500-AtMEGA1284p Web Server Analog Input</title>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
|
||||
<meta http-equiv='pragma' content='no-cache'>
|
||||
<meta http-equiv='content-type' content='no-cache, no-store, must-revalidate'>
|
||||
<script type='text/javascript' src='ajax.js'>
|
||||
</script>
|
||||
<script type='text/javascript' src='ain.js'>
|
||||
</script>
|
||||
<style>.analog {
|
||||
margin-top: 2px;
|
||||
margin-right: 10px;
|
||||
border: 1px solid #ccc;
|
||||
height: 20px;
|
||||
width: 500px;
|
||||
display: block;
|
||||
}
|
||||
.ain{
|
||||
width: 0%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
background: red;
|
||||
float: left;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<input type='text' id='txtain_v6' size='5' disabled='disabled' value=''>
|
||||
<input type='button' value='Get AIN6' pin='6' onclick='getAin(this);'>
|
||||
<input type='button' value='Get AIN6 Auto' onclick='getAin6_update();'><br>
|
||||
|
||||
<div class='analog' style='padding:0px;'>
|
||||
<strong id='ain_v6' name='ain' class='ain' style='width:0%;'></strong>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
57
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ain.js
Normal file
57
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ain.js
Normal file
@@ -0,0 +1,57 @@
|
||||
function AinCallback(o)
|
||||
{
|
||||
var pin = o.ain_p;
|
||||
$('txtain_v'+pin).value = o.ain_v;
|
||||
AinDrawgraph(o);
|
||||
}
|
||||
function getAin(o)
|
||||
{
|
||||
var p = o.attributes['pin'].value;
|
||||
var oUpdate;
|
||||
setTimeout(function()
|
||||
{
|
||||
oUpdate = new AJAX('get_ain'+p+'.cgi',
|
||||
function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
eval(t);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
oUpdate.doGet();
|
||||
}
|
||||
, 300);
|
||||
}
|
||||
function AinDrawgraph(o)
|
||||
{
|
||||
var pin = o.ain_p;
|
||||
var val = o.ain_v;
|
||||
$('ain_v'+pin).style.width = val*500/1023+'px';
|
||||
}
|
||||
function getAin6_update()
|
||||
{
|
||||
var oUpdate;
|
||||
setTimeout(function()
|
||||
{
|
||||
oUpdate = new AJAX('get_ain6.cgi',
|
||||
function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
eval(t);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
oUpdate.doGet();
|
||||
}
|
||||
, 300); setTimeout('getAin6_update()', 500);
|
||||
}
|
||||
27
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ain_gaug.htm
Normal file
27
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ain_gaug.htm
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>W5500-AtMEGA1284p Web Server Analog Input Gauge</title>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
|
||||
<meta http-equiv='pragma' content='no-cache'>
|
||||
<meta http-equiv='content-type' content='no-cache, no-store, must-revalidate'>
|
||||
<script type='text/javascript' src='ajax.js'>
|
||||
</script>
|
||||
<script type='text/javascript' src='https://www.google.com/jsapi'>
|
||||
</script>
|
||||
<script type='text/javascript' src='ain_gaug.js'>
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<input type='text' id='txtain_v6' size='5' disabled='disabled' value=''>
|
||||
<input type='button' value='Get AIN' pin='6' onclick='getAin(this);'>
|
||||
<input type='button' value='Get AIN Auto' onclick='getAin6_update();'><br>
|
||||
<!--Draw the Google Gauge Chart-->
|
||||
|
||||
<div id='chart_div' style='width: 400px; height: 120px;'></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
87
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ain_gaug.js
Normal file
87
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ain_gaug.js
Normal file
@@ -0,0 +1,87 @@
|
||||
google.load('visualization', '1',
|
||||
{
|
||||
packages:['gauge']
|
||||
}
|
||||
); google.setOnLoadCallback(AinDrawGoogleGauge);
|
||||
|
||||
function AinCallback(o)
|
||||
{
|
||||
var pin = o.ain_p;
|
||||
$('txtain_v'+pin).value = o.ain_v;
|
||||
AinDrawGoogleGauge(o);
|
||||
}
|
||||
|
||||
function getAin(o)
|
||||
{
|
||||
var p = o.attributes['pin'].value;
|
||||
var oUpdate;
|
||||
setTimeout(function()
|
||||
{
|
||||
oUpdate = new AJAX('get_ain'+p+'.cgi',
|
||||
function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
eval(t);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
oUpdate.doGet();
|
||||
}
|
||||
, 300);
|
||||
}
|
||||
|
||||
function AinDrawGoogleGauge(o)
|
||||
{
|
||||
var val = o.ain_v;
|
||||
//var temp_val = Number(((((val*3300)/1023)-500)/10).toFixed(2));
|
||||
var temp_val = Number(val); //here in range 0..1023
|
||||
if(isNaN(temp_val)) temp_val = 0;
|
||||
var data = google.visualization.arrayToDataTable([['Label', 'Value'],['ADC6', 80]]);
|
||||
var options =
|
||||
{
|
||||
width: 400,
|
||||
height: 120,
|
||||
max: 1023,
|
||||
min: 0,
|
||||
greenFrom: 0,
|
||||
greenTo: 512,
|
||||
redFrom: 918,
|
||||
redTo: 1023,
|
||||
yellowFrom: 714,
|
||||
yellowTo: 918,
|
||||
majorTicks: ['0', '512', '1023'],
|
||||
minorTicks: 5
|
||||
};
|
||||
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
|
||||
data.setValue(0, 1, temp_val);
|
||||
chart.draw(data, options);
|
||||
}
|
||||
|
||||
function getAin6_update()
|
||||
{
|
||||
var oUpdate;
|
||||
setTimeout(function()
|
||||
{
|
||||
oUpdate = new AJAX('get_ain6.cgi',
|
||||
function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
eval(t);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
oUpdate.doGet();
|
||||
}
|
||||
, 300);
|
||||
setTimeout('getAin6_update()', 500);
|
||||
}
|
||||
68
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ajax.js
Normal file
68
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/ajax.js
Normal file
@@ -0,0 +1,68 @@
|
||||
function AJAX(a, e)
|
||||
{
|
||||
var c = d();
|
||||
c.onreadystatechange = b;
|
||||
function d()
|
||||
{
|
||||
if(window.XMLHttpRequest)
|
||||
{
|
||||
return new XMLHttpRequest()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(window.ActiveXObject)
|
||||
{
|
||||
return new ActiveXObject("Microsoft.XMLHTTP")
|
||||
}
|
||||
}
|
||||
}
|
||||
function b()
|
||||
{
|
||||
if(c.readyState==4)
|
||||
{
|
||||
if(c.status==200)
|
||||
{
|
||||
if(e)
|
||||
{
|
||||
e(c.responseText)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.doGet = function()
|
||||
{
|
||||
c.open("GET", a, true); c.send(null)
|
||||
};
|
||||
this.doPost = function(f)
|
||||
{
|
||||
c.open("POST", a, true);
|
||||
c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
c.setRequestHeader("ISAJAX", "yes");
|
||||
c.send(f)
|
||||
}
|
||||
}
|
||||
function $(a)
|
||||
{
|
||||
return document.getElementById(a)
|
||||
}
|
||||
function $$(a)
|
||||
{
|
||||
return document.getElementsByName(a)
|
||||
}
|
||||
function $$_ie(a, c)
|
||||
{
|
||||
if(!a)
|
||||
{
|
||||
a = "*"
|
||||
}
|
||||
var b = document.getElementsByTagName(a);
|
||||
var e = []; for(var d = 0; d<b.length; d++)
|
||||
{
|
||||
att = b[d].getAttribute("name");
|
||||
if(att==c)
|
||||
{
|
||||
e.push(b[d])
|
||||
}
|
||||
}return e
|
||||
}
|
||||
|
||||
BIN
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/brd_wiz.png
Normal file
BIN
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/brd_wiz.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
24
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/dio.htm
Normal file
24
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/dio.htm
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>W5500-AtMEGA1284p Web Server Digital I/O v1.1</title>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
|
||||
<script type='text/javascript' src='ajax.js'>
|
||||
</script>
|
||||
<script type='text/javascript' src='dio.js'>
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload='getled1();'>
|
||||
<!-- to do -->
|
||||
|
||||
<p id="led1_txt">LED1: unknown..</p>
|
||||
|
||||
<div>
|
||||
<input type='button' value='LED 1 Off' pin='LED1' s='0' onclick='setDiostate(this);'>
|
||||
<input type='button' value='LED 1 On' pin='LED1' s='1' onclick='setDiostate(this);'><br>
|
||||
</div><!-- to do -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
93
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/dio.js
Normal file
93
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/dio.js
Normal file
@@ -0,0 +1,93 @@
|
||||
function DioCallback(o)
|
||||
{
|
||||
var pin = o.dio_p;
|
||||
$('txtdio_s'+pin).value = o.dio_s;
|
||||
$('txtdio_d'+pin).value = o.dio_d;
|
||||
}
|
||||
function led1Callback(o)
|
||||
{
|
||||
$('led1_txt').innerHTML = o.led1_txt;
|
||||
}
|
||||
function getDio(o)
|
||||
{
|
||||
var p = o.attributes['pin'].value;
|
||||
var oUpdate;
|
||||
oUpdate = new AJAX('get_dio'+p+'.cgi',
|
||||
function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
eval(t);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
oUpdate.doGet();
|
||||
}
|
||||
function setDiostate(o)
|
||||
{
|
||||
var p = o.attributes['pin'].value;
|
||||
/*var v=$('txtdio_s'+p).value;*/
|
||||
var v = o.attributes['s'].value;
|
||||
dout = new AJAX('set_diostate.cgi',
|
||||
function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
/*eval(t);*/
|
||||
document.getElementById('led1_txt').innerHTML = t;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
dout.doPost('pin='+p+'&val='+v);
|
||||
}
|
||||
function setDiodir(o)
|
||||
{
|
||||
var p = o.attributes['pin'].value;
|
||||
/*var v=$('txtdio_d'+p).value;*/
|
||||
var v = o.attributes['d'].value;
|
||||
dout = new AJAX('set_diodir.cgi',
|
||||
function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
eval(t);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
dout.doPost('pin='+p+'&val='+v);
|
||||
}
|
||||
function getled1()
|
||||
{
|
||||
var oUpdate;
|
||||
setTimeout(function()
|
||||
{
|
||||
oUpdate = new AJAX('get_led1.cgi',
|
||||
function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
eval(t);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
oUpdate.doGet();
|
||||
}
|
||||
, 300);
|
||||
setTimeout('getled1()', 3000);
|
||||
}
|
||||
BIN
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/favicon.ico
Normal file
BIN
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
14
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/img.htm
Normal file
14
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/img.htm
Normal file
File diff suppressed because one or more lines are too long
25
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/index.htm
Normal file
25
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/index.htm
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>W5500-AtMEGA1284p Web Server</title>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
W5500-AtMEGA1284p Web Server Demopage
|
||||
</div><br>
|
||||
<a href='netinfo.htm'>Network Information</a><br>
|
||||
<a href='img.htm'>Base64 Image Data</a><br>
|
||||
<br>
|
||||
<a href='m1284p.png'>Board Schematic</a><br>
|
||||
<a href='brd_wiz.png'>Mounting Scheme</a><br>
|
||||
<br>
|
||||
<a href='dio.htm'>Ex1> Digital I/O</a><br>
|
||||
<a href='ain.htm'>Ex2> Analog Input</a><br>
|
||||
<a href='ain_gaug.htm'>Ex3> Analog Input: Google Gauge Chart</a><br>
|
||||
<br>
|
||||
<a href='info.htm'>Device Information</a><br>
|
||||
</body>
|
||||
</html>
|
||||
18
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/info.htm
Normal file
18
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/info.htm
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>W5500-AtMEGA1284p Device Info</title>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
|
||||
<script type='text/javascript' src='ajax.js'>
|
||||
</script>
|
||||
<script type='text/javascript' src='info.js'>
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload='getInfo();'>
|
||||
<div>
|
||||
W5500-AtMEGA1284p Device Information
|
||||
</div><br>
|
||||
<p id="info_txt">..</p></body>
|
||||
</html>
|
||||
21
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/info.js
Normal file
21
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/info.js
Normal file
@@ -0,0 +1,21 @@
|
||||
function getInfo()
|
||||
{
|
||||
var oUpdate;
|
||||
setTimeout(function()
|
||||
{
|
||||
oUpdate = new AJAX('get_info.cgi', function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
//*eval(t);
|
||||
document.getElementById('info_txt').innerHTML = t;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
); oUpdate.doGet();
|
||||
}
|
||||
, 300); setTimeout('getInfo()', 3000);
|
||||
}
|
||||
BIN
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/m1284p.png
Normal file
BIN
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/m1284p.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
33
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/netinfo.htm
Normal file
33
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/netinfo.htm
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>W5500-AtMEGA1284p Web Server Network Info</title>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
|
||||
<style>
|
||||
label{float:left;text-align:left;width:50px;}li {list-style:none;}
|
||||
</style>
|
||||
<script type='text/javascript' src='ajax.js'>
|
||||
</script>
|
||||
<script type='text/javascript' src='netinfo.js'>
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad='getNetinfo()'>
|
||||
<div>
|
||||
W5500-AtMEGA1284p Web Server Network Information
|
||||
</div><br>
|
||||
|
||||
<ul>
|
||||
<li><label for='txtmac'>MAC:</label><input id='txtmac' name='mac' type='text' size='20' disabled='disabled'></li>
|
||||
|
||||
<li><label for='txtip'>IP:</label><input id='txtip' name='ip' type='text' size='20' disabled='disabled'></li>
|
||||
|
||||
<li><label for='txtgw'>GW:</label><input id='txtgw' name='gw' type='text' size='20' disabled='disabled'></li>
|
||||
|
||||
<li><label for='txtsn'>SN:</label><input id='txtsn' name='sn' type='text' size='20' disabled='disabled'></li>
|
||||
|
||||
<li><label for='txtdns'>DNS:</label><input id='txtdns' name='dns' type='text' size='20' disabled='disabled'></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
37
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/netinfo.js
Normal file
37
16_m1284p_WIZNET_HTTPD_FTPD_FATFS_SDCARD/WWW/netinfo.js
Normal file
@@ -0,0 +1,37 @@
|
||||
function NetinfoCallback(o)
|
||||
{
|
||||
$('txtmac').value = o.mac;
|
||||
$('txtip').value = o.ip;
|
||||
$('txtgw').value = o.gw;
|
||||
$('txtsn').value = o.sn;
|
||||
$('txtdns').value = o.dns;
|
||||
if(typeof(window.external)!='undefined')
|
||||
{
|
||||
obj = $$_ie('input', 'dhcp');
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = $$('dhcp');
|
||||
}
|
||||
}
|
||||
function getNetinfo()
|
||||
{
|
||||
var oUpdate;
|
||||
setTimeout(function()
|
||||
{
|
||||
oUpdate = new AJAX('get_netinfo.cgi', function(t)
|
||||
{
|
||||
try
|
||||
{
|
||||
eval(t);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
oUpdate.doGet();
|
||||
}
|
||||
, 1500);
|
||||
}
|
||||
Reference in New Issue
Block a user