Last active
December 31, 2015 12:19
-
-
Save kahagon/7985876 to your computer and use it in GitHub Desktop.
WiringPi-PHP の API 使用例です。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $pin = 6; | |
| print "Setting up pin $pin" . PHP_EOL; | |
| wiringPiSetup(); | |
| pinMode($pin, 1); | |
| for ($i = 0; $i < 20; $i++) { | |
| print "Turning on pin $pin" . PHP_EOL; | |
| digitalWrite($pin, 1); | |
| print "Sleeping" . PHP_EOL; | |
| sleep(1); | |
| print "Turning off pin $pin" . PHP_EOL; | |
| digitalWrite($pin, 0); | |
| print "Sleeping" . PHP_EOL; | |
| sleep(1); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment