Ive been busy but I got back around to working on my simple lan project. I had it working before but cant get it going again.Can anyone take a look at it and help me troubleshoot it for once and for all? I believe I have the hardware connected properly.Here is my HTML for the simple lan:
<body bgcolor="#DCDCDC">
<META HTTP-EQUIV="refresh" CONTENT="3; URL=rrlay.html">
<!--
Note: When a port is high, the relay does not conduct - So low=on high=off
-->
<SCRIPT>
function writeStatus(val) {
if (val == 0)
return "ON";
if (val == 1)
return "OFF";
if (val == 2)
return "Cycling";
}
function writeColor(val) {
if (val == 0)
return "#669933";
if (val == 1)
return "#FF3333";
if (val == 2)
return "#FFFF33";
}
function listPort(id, title, val, varname) {
document.write("<TABLE height=50 width=200 BODER=0 CELLSPACING='0'>");
document.write("<TR height=50 bgcolor='");
document.write(writeColor(val));
document.write("'><TD width=30>"+id+"</TD><TD width=100>"+title+"</TD>");
document.write("<TD width=70>");
if (val == 0)
document.write("<a href='rrlay.html?"+varname+"=1'>OFF</a><br>")
if (val == 1)
document.write("<a href='rrlay.html?"+varname+"=0'>Turn on</a>");
if (val == 0)
document.write("<a href='rrlay.html?"+varname+"=2'>ON</a>");
document.write("</TD></TR></TABLE>");
}
</SCRIPT>
<center><font size="24px" color="navy"><b>CAMERA CONTROL</b></font><br><br>
<TABLE BODER=0 CELLSPACING="5">
<script>
document.write("<TR><TD>");
listPort(1,"UP","0","At_var20");
document.write("</TD><TD>");
listPort(2,"DOWN","0","At_var21");
document.write("</TR><TR><TD>");
listPort(3,"LEFT","0","At_var22");
document.write("</TD><TD>");
listPort(4,"RIGHT","0","At_var23");
document.write("</TR><TR><TD>");
listPort(5,"ZOOM IN","0","At_var24");
document.write("</TD><TD>");
listPort(6,"ZOOM OUT","0","At_var25");
document.write("</TR><TR><TD>");
listPort(7,"RELAY 7","0","At_var26");
document.write("</TD><TD>");
listPort(8,"RELAY 8","0","At_var27");
document.write("</TD></TR></TABLE>");
</script>
</TABLE>
<br><br>
<!--
<a href="index.html?At_var20=1&At_var21=1&At_var22=1&At_var23=1&At_var24=1&At_var25=1&At_var26=1&At_var27=1">Turn off all</a><br>
<a href="index.html?At_var20=0&At_var21=0&At_var22=0&At_var23=0&At_var24=0&At_var25=0&At_var26=0&At_var27=0">Turn on all</a><br>
-->
Here is the 28x code that I am using:
picaxe 28x1
setfreq m8 'set frequency to 8mhz
do
timedout1:
SEROUT 0, t1200, ("!AT0R20") '!ATOR=Read 20=position
SERIN [1000,timedout1],0, t1200, #b0 'on timeout try again
SEROUT 0, t1200, ("!AT0R21") '!ATOR=Read 20=position
SERIN [1000,timedout1],0, t1200, #b1 'on timeout try again
SEROUT 0, t1200, ("!AT0R22") '!ATOR=Read 20=position
SERIN [1000,timedout1],0, t1200, #b2 'on timeout try again
SEROUT 0, t1200, ("!AT0R23") '!ATOR=Read 20=position
SERIN [1000,timedout1],0, t1200, #b3 'on timeout try again
if b0 = 2 then
LOW 4
endif
if b0 = 1 then
HIGH 4
endif
if b1 = 2 then
LOW 1
endif
if b1 = 1 then
HIGH 1
endif
if b2 = 2 then
LOW 2
endif
if b2 = 1 then
HIGH 2
endif
if b3 = 2 then
LOW 3
endif
if b3 = 1 then
HIGH 3
endif
'pause 100
loop
Thanks ALOT for any help
<body bgcolor="#DCDCDC">
<META HTTP-EQUIV="refresh" CONTENT="3; URL=rrlay.html">
<!--
Note: When a port is high, the relay does not conduct - So low=on high=off
-->
<SCRIPT>
function writeStatus(val) {
if (val == 0)
return "ON";
if (val == 1)
return "OFF";
if (val == 2)
return "Cycling";
}
function writeColor(val) {
if (val == 0)
return "#669933";
if (val == 1)
return "#FF3333";
if (val == 2)
return "#FFFF33";
}
function listPort(id, title, val, varname) {
document.write("<TABLE height=50 width=200 BODER=0 CELLSPACING='0'>");
document.write("<TR height=50 bgcolor='");
document.write(writeColor(val));
document.write("'><TD width=30>"+id+"</TD><TD width=100>"+title+"</TD>");
document.write("<TD width=70>");
if (val == 0)
document.write("<a href='rrlay.html?"+varname+"=1'>OFF</a><br>")
if (val == 1)
document.write("<a href='rrlay.html?"+varname+"=0'>Turn on</a>");
if (val == 0)
document.write("<a href='rrlay.html?"+varname+"=2'>ON</a>");
document.write("</TD></TR></TABLE>");
}
</SCRIPT>
<center><font size="24px" color="navy"><b>CAMERA CONTROL</b></font><br><br>
<TABLE BODER=0 CELLSPACING="5">
<script>
document.write("<TR><TD>");
listPort(1,"UP","0","At_var20");
document.write("</TD><TD>");
listPort(2,"DOWN","0","At_var21");
document.write("</TR><TR><TD>");
listPort(3,"LEFT","0","At_var22");
document.write("</TD><TD>");
listPort(4,"RIGHT","0","At_var23");
document.write("</TR><TR><TD>");
listPort(5,"ZOOM IN","0","At_var24");
document.write("</TD><TD>");
listPort(6,"ZOOM OUT","0","At_var25");
document.write("</TR><TR><TD>");
listPort(7,"RELAY 7","0","At_var26");
document.write("</TD><TD>");
listPort(8,"RELAY 8","0","At_var27");
document.write("</TD></TR></TABLE>");
</script>
</TABLE>
<br><br>
<!--
<a href="index.html?At_var20=1&At_var21=1&At_var22=1&At_var23=1&At_var24=1&At_var25=1&At_var26=1&At_var27=1">Turn off all</a><br>
<a href="index.html?At_var20=0&At_var21=0&At_var22=0&At_var23=0&At_var24=0&At_var25=0&At_var26=0&At_var27=0">Turn on all</a><br>
-->
Here is the 28x code that I am using:
picaxe 28x1
setfreq m8 'set frequency to 8mhz
do
timedout1:
SEROUT 0, t1200, ("!AT0R20") '!ATOR=Read 20=position
SERIN [1000,timedout1],0, t1200, #b0 'on timeout try again
SEROUT 0, t1200, ("!AT0R21") '!ATOR=Read 20=position
SERIN [1000,timedout1],0, t1200, #b1 'on timeout try again
SEROUT 0, t1200, ("!AT0R22") '!ATOR=Read 20=position
SERIN [1000,timedout1],0, t1200, #b2 'on timeout try again
SEROUT 0, t1200, ("!AT0R23") '!ATOR=Read 20=position
SERIN [1000,timedout1],0, t1200, #b3 'on timeout try again
if b0 = 2 then
LOW 4
endif
if b0 = 1 then
HIGH 4
endif
if b1 = 2 then
LOW 1
endif
if b1 = 1 then
HIGH 1
endif
if b2 = 2 then
LOW 2
endif
if b2 = 1 then
HIGH 2
endif
if b3 = 2 then
LOW 3
endif
if b3 = 1 then
HIGH 3
endif
'pause 100
loop
Thanks ALOT for any help