I've been working on a Obstacle avoidance robot using Ultrasonic and IR sensors.
The scope of my project is to execute my program over the air.
- Control the robot's movement using mouse or touch screen.
- Execute the obstacle avoidance program
The program for "robot movements" is written in very basic cgi scripts (just by controlling the GPIO pins and thus the respective motors)
gpio -g write 13 1
The second program is written in Python.
My Question :
- Can a HTML page directly execute .py files?
- If not please guide some tutorials about .cgi programming or Python scripts in such a file. Or just how should i proceed, do i need to learn PHP or HTML programming?
Basically This is the code, making a button.
<button style="height: 75px; width: 75px" onclick="forward()"><img style="height: 65px"src="/images/forward.png"></button>
This is suppose to call the function below, but the .py file is not executed
function forward()
{
xmlhttp.open("GET","cgi-bin/forward.py",true);
xmlhttp.send();
}
I'm new to this kind of over the air controlling. Any help would be appriciated
system()
-like command can you use that to start (or stop?) your python script as a background process? Beware though, usingsystem()
is frowned upon in some circles (EDIT: one expansion on why it's frowned upon) – Roger Jones Dec 5 '18 at 13:03