-
-
Save dewski/2512564 to your computer and use it in GitHub Desktop.
teleduino
This file contains 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 | |
include_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'_config.php'); | |
include_once(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'teleduino328_php.php'); | |
if(isset($_SERVER['HTTP_HOST'])) | |
{ | |
echo "<pre>"; | |
} | |
$Teleduino328PHP = new Teleduino328PHP(); | |
$Teleduino328PHP->setModeEthernetClientProxy($config['ethernet_client_proxy_key']); | |
echo "defineServo:\n"; | |
$servo = 0; // Servo (0 - 5) | |
$pin = 3; // Servo pin (0 - 21) | |
$result = $Teleduino328PHP->defineServo($servo, $pin); | |
echo print_r($result, true)."\n"; | |
echo "setServo:\n"; | |
$servo = isset($_GET['servo']) ? ((int) $_GET['servo']) : 0; // Servo (0 - 5) | |
$position = isset($_GET['position']) ? ((int) $_GET['position']) : 180; // Servo position (0 - 180) | |
$result = $Teleduino328PHP->setServo($servo, $position); | |
echo print_r($result, true)."\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment