Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Feeder Stepper Control
- #include <Stepper.h>
- #define STEPS_PER_TURn 200 // Steps per turn
- Stepper stepper(STEPS_PER_TURn, 8, 9, 10, 11); // Wiring
- // the previous reading from the analog input
- const int position_min = 0; // Origin
- const int position_max = 2000; // Steps for Feeder Full Sweep
- void setup() {
- stepper.setSpeed(30); // Stepper speed, RPM
- }
- void loop() {
- // move a number of steps equal to the change in the
- // sensor reading
- stepper.step(position_max - position_min);
- stepper.step(position_min - position_max);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement