Device-Firmata

 view release on metacpan or  search on metacpan

examples/example_stepper.pl  view on Meta::CPAN

		my $lastStep = $context->{progStep};
		$nextStep = ($lastStep == scalar(@stepperProgram) - 1) ? 0 : $lastStep + 1;
	}
	
	my @nextProg = @{$stepperProgram[$nextStep]};

	$context->{progStep} = $nextStep;
	$device->stepper_step(0,$nextProg[0],$nextProg[1],$nextProg[2]);
}

sub updatePosition {
	my ($context) = @_;

	my @stepperProgram = @{$context->{program}};
	my $lastStep = $context->{progStep};
	my @lastProg = @{$stepperProgram[$lastStep]};

	if ($lastProg[0] > 0) {
		$context->{position} -= $lastProg[1];
	} else {
		$context->{position} += $lastProg[1];

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.452 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )