Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <AccelStepper.h>
- #define homeSW 2
- #define pinSW 3
- #define actionWater 0
- AccelStepper steppers[3] = {
- AccelStepper(1, 4, 5),
- AccelStepper(1, 6, 7),
- AccelStepper(1, 8, 9)
- };
- void setup() {
- pinMode(homeSW, INPUT_PULLUP);
- pinMode(pinSW, INPUT_PULLUP);
- delay(5);
- stepper.setMaxSpeed(5000);
- stepper.setAcceleration(5000);
- Serial.begin(9600);
- Serial.println("Started!");
- for(int i = 0; i < steppers.length; i++) {
- doHoming(i);
- }
- }
- void loop() {
- }
- /**
- * Accepts stepper index and moves it back to 0.
- * @param st - The stepper's index.
- */
- void doHoming(int st) {
- }
- /**
- * Moves motor to x, y, z
- * @param x the x location
- * @param y the y location
- * @param z the z location
- */
- void goto(int x, int y, int z) {
- Serial.println("Moved to: " + (String) x + ", " + (String) y + ", " + (String) z);
- }
- /**
- * Does an action all the grid points
- */
- void grid(int action) {
- Serial.println("Did action " + action);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement