Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function testGPIO($pin)
- {
- for ($p = 0; $p <= 100; $p++)
- {
- #percent = $p
- for ($i = 0; $i <= 100; $i++)
- {
- #set pin = 1
- shell_exec("gpio write ".$pin." 1");
- #wait
- sleep(($p*(5/100))/1000);
- #set pin = 0
- shell_exec("gpio write ".$pin." 0");
- #wait until next loop
- sleep((5-($p*(5/100)))/1000);
- }
- echo "<script> currentPercent(".$p."); </script>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement