0 Replies Latest reply on Feb 13, 2013 11:16 AM by Teslapow84

    Integrating a index of string into button!

    Teslapow84

      Hello!

       

      I'm trying to get this code working where I want to integrate a shortcut for clicking an button made in Egde Animate.

      The code snippets you see is just some copied areas of the whole working code, don't need to read more code than this.

       

      Serial.print(c);

              if (c == '\n') {

                if (readString.indexOf("?") <0)

                {

                  //do nothing

                }

                else

                {

                   if(readString.indexOf("UP=UP") >0)

                     {

                       movetiltupstep();

                     }

      // now output HTML data starting with standard header

                client.println("HTTP/1.1 200 OK");

                client.println("Content-Type: text/html");

                client.println();

                //set background to green

                client.print("<body style=background-color:green>");

                client.println("<hr />");

                client.println("<center>");

                client.println("<h1>Servo control</h1>");

                client.println("<form method=get name=SERVO>");

                client.println("<input type=submit value=UP name=UP style=\"width:100px\"><br>");

                client.println("<input type=submit value=LT name=LT style=\"width:100px\"><input type=submit value=CN name=CN style=\"width:100px\"><input type=submit value=RT name=RT style=\"width:100px\"><br>");

                client.println("<input type=submit value=DN name=DN style=\"width:100px\">");

                client.println("</form>");

                client.println("</center>");

                client.println("</body></html>");

                //clearing string for next read

                readString="";

                //stopping client

                client.stop();

                  }

                }

              }

            }

      }

       

      void movetiltupstep(){

        tiltpos = tilt.read();

        Serial.println(tiltpos);

        if (tiltpos >= 66)

        {

        tilt.write(tiltpos - 2);

        }

      }

       

      This is just an overview of my setup for a webpage, where I can move a servo with a button and this is called movetiltupstep();

      The ordinary button is made here, ("<input type=submit value=UP name=UP style=\"width:100px\"><br>"); and I want to use this with an interactive button in Edge Animate.

       

      For making a button in Edge Animate, this is the setup, function(sym, e) and I tried to integrate something like this:

       

      // insert code for mouse click here

       

      "<input type=submit value=UP name=UP>" Here is my problem, this is the ordinary code, but how to integrate this string index so that the button can be interactive?

       

      How would i proceed with this problem, ideas anyone?

      Regards, Tor