Need Help Please I Don't under stand

I have a reed switch put in pin 1 and Digital Input code shows log device (file attached) that information i want to put on a web page live. Can this be done? Any code out there? I have looked up Electric Imp Breakout Hookup Guide and a heap of others like it but i want the information come like posts not like a switch. Any Ideas

Can your web page be the imp agent itself, or do you require the web page to be one of your pages somewhere on the internet?

The imp agent can be it’s own web page.

Hi thanks for the reply. I am not sure. I want the owner of each imp to be able to see when the reed switch is openned or closed live or in a weekly/monthly reported email.
In answer to ur question I think the imp agent would be fine. I can give my clients a link from my website to the agent link. Once they become a member. Or do u have a better way of doing this? Thanks

You can take a look at my HackIndicator project - which is a pretty bare bones project that uses a button and an LED to indicate whether or not I am busy.

It also serves up a super simple webpage from the agent to indicate my current status. This might be a good starting point for your project.

Hi beardedinventor thanks for your HackIndicator project. I get this message from the agent link NOT HACKING (as of 1412122887) - via an @electricimp agent . Do I have to be on twitter to see? Thanks for your time

I’m not totally sure I understand your question…

The agent link serves up a webpage (take a look at the http.onrequest code in the agent) that displays a variable that is changed by pressing a button on the device.

Oh sorry ill try to explain the question better.
I copyed and pasted both ur device code and agent code from Hackindicator and hit the build and run button when i open and close the reed switch the led comes on and off then I hit the agent URL link and I get this on the link (the agent link Not Hacking as of 1412122887- via an electic imp agent. What does this mean?

The device code is setup so each time the button is pressed (or more specifically, pressed and then released) the state is swapped, and sent up to the agent.

The webpage the agent serves up displays the last state (hacking/not hacking) and a timestamp to indicate when that state changed. So your webpage saying “Not Hacking as of 1412122887” is telling you that the last state change was to the “Not Hacking” and that the state change happened at 1412122887 (which is Wed, 01 Oct 2014 00:21:27 GMT).

Thanks so much!! The penny is starting to drop having a little play around with it.
I’ll try to work some more out thanks again

Hi Beardedinventor I have spent the last few days trying to get this project how i want it and learn more about the imp’s coding but I keep comming up short can you please help me or point me in the right direction with these couple of things. The number that is the date and time I have know Idea how to change it on the site I think that i have to add the code to the html with UTC+10 or is it a change to (as of %i) . And also I am wanting the post not to be shown just once but to continue down the page as the reed switch is openned and closed. Is the answer in the

of the html or I have watched some videos that make me think css but not sure. If you can let me know if I am on the right track or not even close that would be great. Thanks very much for your time Josh

The number that is the date time is a Unix Timestamp - there are multiple ways in JavaScript for handling date/time information.

You’ll need to use some Javascript and HTML to have the reed switch log each time it changes. I encourage you to take a look at some basic ajax tutorials - which will go through how to make asyncronous web requests from Javascript and modify the webpage in response to it… Here’s one to get you started:

Web development is a pretty big topic, and we’re hoping to build out some resources eventually, but there are a lot of resources out there already, so it’s a bit lower on the list :slight_smile:

That’s great thanks a gain I don’t mind to learn how to do it makes me understand how it works . Thanks again for your time