Skip to content

Commit

Permalink
Updated example
Browse files Browse the repository at this point in the history
  • Loading branch information
calcinai committed Aug 13, 2016
1 parent afb305f commit d82ba5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/motor-step-2phase.php → examples/motor-step.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
*/


use Calcinai\PHPi\External\Generic\Motor\Stepper\TwoPhase;
use Calcinai\PHPi\External\Generic\Motor\Stepper;

include __DIR__.'/../vendor/autoload.php';

$board = \Calcinai\PHPi\Factory::create();

$motor = new TwoPhase($board->getPin(5), $board->getPin(6), $board->getPin(13), $board->getPin(19));
//This is for a 4 phase motor - can be any number of phases
$motor = new Stepper([$board->getPin(5), $board->getPin(6), $board->getPin(13), $board->getPin(19)]);

$board->getLoop()->addPeriodicTimer(0.5, [$motor, 'step']);

Expand Down

0 comments on commit d82ba5b

Please sign in to comment.