ahmed_salah Posted July 10, 2014 Share Posted July 10, 2014 hi, i am new in html scripting ,this project using to control relay with netduino board , the code is attached it is a simple js page contains 2 buttons one for on and another for off , i want to when this page is displayed the status of led is displayed to to know if it is on or off for example a button box contains led is on with green color and the opposite button box with red color when led is off LedController.cs.txt Link to comment Share on other sites More sharing options...
justsomeguy Posted July 10, 2014 Share Posted July 10, 2014 You'll need to add another route to get the status of the LED, however you do that with Netduino. Then you can add another ajax request to get the status of the LED when the page loads and show whether it is on or off. To change that, one way would be to add code inside the ajax request to change the LED so that it also updates the page (in that case, you're assuming what the LED state is). The other option is to send the ajax request to change the LED, then send another ajax request to get the status of the LED and update the page. Link to comment Share on other sites More sharing options...
ahmed_salah Posted July 10, 2014 Author Share Posted July 10, 2014 hi, thanks for replay but i did not undrestand what i can do exactly as i say before i am new in scripting so could you please guide me how i can modify code with sample Link to comment Share on other sites More sharing options...
justsomeguy Posted July 10, 2014 Share Posted July 10, 2014 I've never used Netduino, I don't know how to set up a new route for it. I suggest looking at the documentation for it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now