Skip to content
Advertisement

How to map buttons in html to running an executable file

<!DOCTYPE html>
<html>
<head>
</head>
<body>

<h1>Led On/Off</h1>

<input type="button" value="Led on" onclick="RunFile();"/>
<input type="button" value="Led off" onclick="RunFile();"/>

</body>
</html>

This is my html code. I’d link to map those buttons to 2 executable files to switch on and off led in wandboard. How will i do it?

Advertisement

Answer

According to your comment the LED is connected to the Server while you try toggle it from a client.

Since the HTML Page you send to the client is then rendered locally (on the CLIENT) you will have to create some kind of LED Toggle Service on the Server. You would add a call to the Service to your HTML page. This for example could be a link:

<a href="myLEDService/LED/ON"> Led On </a>
<a href="myLEDService/LED/OFF"> Led Off </a>

I can only speculate what your executeable to toggle the LED is, and based on the assumption that the apache tag you added is accurate you might want to have a look at Apache CGI

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement