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 | |
| require dirname(__FILE__) . '/vendor/autoload.php'; | |
| use \PHPMake\Firmata; | |
| $devName = '/dev/tty.usbmodemfa131'; | |
| class DigitalPinObserver implements Firmata\Device\PinObserver { | |
| public $count = 0; | |
| public $limit = 3; |
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 | |
| function function_abstract() { | |
| print "Hello, World\n"; | |
| } | |
| function_abstract(); |
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
| { | |
| "name": "phpmake/example-blink-led", | |
| "type": "project", | |
| "require": { | |
| "phpmake/firmata": "dev-master" | |
| } | |
| } |
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 | |
| use PHPMake\SerialPort as SerialPort; | |
| define('START_SYSEX', 0xf0); | |
| define('END_SYSEX', 0xf7); | |
| define('QUERY_FIRMWARE', 0x79); | |
| $p = new SerialPort('/dev/ttyACM0'); | |
| $p->setBaudRate(57600)->setCanonical(false)->setVTime(1)->setVMin(0); |
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
| #!/bin/bash | |
| now=`date +"%Y%m%d%H%M%S"` | |
| dotfile="/tmp/$now.dot" | |
| imgfile="/tmp/$now.png" | |
| git graphviz "$@" > $dotfile | |
| dot -Tpng -o $imgfile $dotfile | |
| eog $imgfile | |
| rm $dotfile $imgfile |
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 | |
| require 'vendor/autoload.php'; | |
| use PhpGpio\Gpio; | |
| $pin = 25; | |
| print "Setting up pin $pin" . PHP_EOL; | |
| $gpio = new GPIO(); | |
| $gpio->setup($pin, "out"); |
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; |
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 | |
| phpinfo(); |
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
| auto lo | |
| iface lo inet loopback | |
| iface eth0 inet static | |
| address 192.168.24.57 | |
| netmask 255.255.255.0 | |
| gateway 192.168.24.1 | |
| allow-hotplug wlan0 | |
| iface wlan0 inet manual |
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
| auto lo | |
| iface lo inet loopback | |
| iface eth0 inet dhcp | |
| allow-hotplug wlan0 | |
| iface wlan0 inet manual | |
| wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf | |
| iface default inet dhcp |
NewerOlder