Loading a different web page depending on a i/o port state
dhenninger
Posts: 2
I would like to load one web page if a specific i/o port is "High" and a different web page if that i/o port is "low"
Could anyone help me with code to accomplish this??
Thank you
Could anyone help me with code to accomplish this??
Thank you
Comments
Spinneret source code can be found on the code repo.
It should be straight forward to modify either code bases to read pin state similar to the attached code.
Take a look at WebServer_W5100_RTC or WebSErver_W5100 in the code repo and find the method PRI RenderDynamic(id). You'll see a filter for "pinstate.xml" and an associated method, PRI BuildPinStateXml(strpin, strvalue) | pin, value, state, dir . This method sets and reads the state of a pin as requested by an HTTP GET and returns XML.
Of course you'll need to use the DHCP assigned IP which can be found by opening the Parallax Serial Terminal right after loading the web server code.
Anyway, take a look at the code and see if that sparks any ideas.