0 Replies Latest reply on Feb 13, 2013 7:47 AM by Teslapow84

    Integrating code for mouse click!

    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,

       

      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 button is made here, ("<input type=submit value=UP name=UP style=\"width:100px\"><br>"); and I want to use this with the button in Edge Animate.

       

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

       

      // insert code for mouse click here

      sym.$("<input type=submit value=UP name=UP>")  but not working.

       

      How would i proceed with this problem, ideas anyone?

      Regards, Tor