func doStep(motor *motor.Motor, s step) {

	clockwise, duration := rotationInDegreeToMove(s.stepsBySecond, s.rotationInDegree)

	motor.Enable()
	log.Info("[%3d] Moving [%6s] -- clockwise[%v] at %v[steps/s] for %v", s.id, fmt.Sprintf("%3.2f", s.rotationInDegree), clockwise, s.stepsBySecond, duration)
	motor.Move(clockwise, s.stepsBySecond, duration)
	motor.Disable()
}
Exemple #2
0
func doStep(motor *motor.Motor, clockwise bool, stepsBySecond uint32, duration time.Duration) {
	motor.Enable()
	log.Info("Moving clockwise[%v] for %v at %v[steps/s]", clockwise, duration, stepsBySecond)
	motor.Move(clockwise, stepsBySecond, duration)
	motor.Disable()
}