Skip to content

Instantly share code, notes, and snippets.

@ricardoreis
Last active June 23, 2018 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricardoreis/d24ab565ba08e1ad73d1ab1a4e54370b to your computer and use it in GitHub Desktop.
Save ricardoreis/d24ab565ba08e1ad73d1ab1a4e54370b to your computer and use it in GitHub Desktop.
2.php
<?php
session_start();
if(!isset($_SESSION['val'])){
exec("gpio -g mode 18 pwm && gpio pwm-ms && gpio pwmc 192 && gpio pwmr 2000");
}
function giraMotor(){
exec('gpio -g pwm 18 60');
}
giraMotor();
?>
<html>
<p>Ok! PAGAMENTO RECEBIDO E MOTOR ACIONADO</p>
<script>
setTimeout(function(){window.location.href = "1.php";}, 1000);
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment