4 #include "std/initializer_list.h" 29 Driver(std::initializer_list<uint8_t> pins);
38 void turn(int16_t degree);
46 void turnTo(uint16_t target_angle);
63 void setWaiter(
void (*waiter)(
unsigned int));
66 uint8_t pins[4] = {-1, -1, -1, -1};
67 uint16_t steps_per_rotation = 510;
68 uint16_t current_step_position = 0;
69 uint16_t current_degree_position = 0;
70 void (*waiter)(
unsigned int) = &delayMicroseconds;
78 void executeStep(uint8_t step);
88 #endif // _STEPPER_MOTOR Driver(std::initializer_list< uint8_t > pins)
Create a new driver instance using the given pins.
void turn(int16_t degree)
Relative turn.
void turnTo(uint16_t target_angle)
Absolute turn.
void setStepsPerRotation(uint16_t steps)
Set the steps needed for one complete rotation.
Driver for an 8-step stepper motor
void setWaiter(void(*waiter)(unsigned int))
Set a custom waiter.