Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of httpServer by
Revision 2:4c6d58b112d3, committed 2015-10-05
- Comitter:
- schenk
- Date:
- Mon Oct 05 06:35:09 2015 +0000
- Parent:
- 1:772534e3b627
- Commit message:
- window
Changed in this revision
Handler/FsHandler.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 772534e3b627 -r 4c6d58b112d3 Handler/FsHandler.cpp --- a/Handler/FsHandler.cpp Tue Jun 30 00:21:41 2015 +0000 +++ b/Handler/FsHandler.cpp Mon Oct 05 06:35:09 2015 +0000 @@ -4,12 +4,10 @@ //#define DEBUG #include "hl_debug.h" -DigitalOut led_red(LED1); -DigitalOut led_green(LED2); -DigitalOut led_blue(LED3); + DigitalIn din(PC_14); - +int mode2 = 0; static int matchstrings(const char* one, const char* two) { @@ -98,7 +96,7 @@ // Check if we received a directory with the local bath if ((m_localPath.length() == 0) || (m_localPath.substr( m_localPath.length()-1, 1) == "/")) { // yes, we shall append the default page name - m_localPath += "index.html"; + m_localPath += "dio_page.html"; } reqPath = m_rootPath + m_localPath; @@ -151,18 +149,39 @@ if( std::string::npos != msg.uri.find("set_dio.cgi") ) { pin = get_http_param_value("pin"); - if(pin == 8) - { - led_red = get_http_param_value("val"); + + + if(pin == 9) + { + if(get_http_param_value("val") == 0){ + DigitalOut(D9,0); + DigitalOut(D8,1); + wait(0.87); + DigitalOut(D9,0); + DigitalOut(D8,0); + }// opened status + else{ + DigitalOut(D9,1); + DigitalOut(D8,0); + wait(0.8); + DigitalOut(D9,0); + DigitalOut(D8,0); + //closed status + } + } - else if(pin == 9) - { - led_green = get_http_param_value("val"); + else if(pin == 10) + { + if(get_http_param_value("val") == 0){ + DigitalOut(D13,1); + }// turn on + else{ + DigitalOut(D13,0); + + }//turn off + } - else if(pin == 5) - { - led_blue = get_http_param_value("val"); - } + else { WARN("Wrong pin number");