I was able to control one arm of an OWI-535 (Maplin) Robot Arm using GPIO pins and python programming (via L293 driver) , so I tried to do the same using a web page created in PHP.
Created buttons for forward and reverse motions and tried to call the python program but it does work.
The web page is being displayed and when I press the button, the strings 'test1 and test2' corresponding to the button press is being displayed. (using echo function in php)
I'm using LIGHTTPD web server. Here is the code.
<html>
<head>
<?php
if(isset($_POST['ForwardMotion']))
{
exec('sudo python /var/www/ArmForward.py');
echo "test1";
}
if(isset($_POST['BackwardMotion']))
{
exec('sudo python /var/www/ArmBackward.py ');
echo"test2";
}
if(!(isset($_POST['ForwardMotion'])) & !isset($_POST['BackwardMotion']))
{
echo"</head>";
echo"<body>
<form id=\"form1\" name=\"form1\" method=\"post\" action=\"Roboarmdemo.php\">
<table width=\"333\" height=\"124\" border=\"1\">
<tr>
<td width=\"155\" height=\"30\"> UPWARD</td>
<td width=\"162\">DOWNWARD</td>
</tr>
<tr>
<td><input type=\"submit\" name=\"ForwardMotion\" value=\"Forward\" /></td>
<td><input type=\"submit\" name=\"BackwardMotion\" value=\"Backward\" /></td>
</tr>
</table>
</form>
</body>
</html>";
}
?>