Skip to content

Instantly share code, notes, and snippets.

@atypical
Created April 27, 2012 20:10
Show Gist options
  • Save atypical/2512537 to your computer and use it in GitHub Desktop.
Save atypical/2512537 to your computer and use it in GitHub Desktop.
teleduino
<?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 = 0; // Servo (0 - 5)
$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