Advertisement
Guest User

Algorythmus zur Impulsberechnung mit 200Hertz Die Sekunde

a guest
May 25th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. function testGPIO($pin)
  2. {
  3.     for ($p = 0; $p <= 100; $p++)
  4.     {
  5.         #percent = $p
  6.        
  7.         for ($i = 0; $i <= 100; $i++)
  8.         {
  9.             #set pin = 1
  10.             shell_exec("gpio write ".$pin." 1");
  11.             #wait
  12.             sleep(($p*(5/100))/1000);
  13.             #set pin = 0
  14.             shell_exec("gpio write ".$pin." 0");
  15.            
  16.             #wait until next loop
  17.             sleep((5-($p*(5/100)))/1000);
  18.            
  19.         }
  20.        
  21.         echo "<script> currentPercent(".$p."); </script>";
  22.        
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement