Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # see the status of the component, and display the other button
- function displayButton($component, $status){
- if ($status == O )
- {
- echo '<form action="" method="post">';
- echo '<input type="hidden" name="ON" value="0"/><input type="submit" value="ON"/></form>';
- }
- else if ($status == 1 )
- {
- echo '<form action="" method="post">';
- echo '<input type="hidden" name="OFF" value="1"/><input type="submit" value="OFF"/></form>';
- }
- if (isset($_POST['OFF']))
- {
- $command = "0";
- echo $command;
- exec("/home/debian/Desktop/EOS/Week44/I2CDriver $command $component",$output);
- }
- else if (isset($_POST['ON']))
- {
- $command = "1";
- echo $command;
- exec("/home/debian/Desktop/EOS/Week44/I2CDriver $command $component",$output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement