What did u use for driver motor? And series stepper motor? . is it nema17 for stepper motor?
@arnoldschmucker99772 жыл бұрын
Easydriver
@mehmetkanis56992 жыл бұрын
Kann ich den sketch sehen ?
@arnoldschmucker99772 жыл бұрын
It has been too long. I have lost it. I suggest www.airspayce.com. I can also recommend Brainybits website.
@arnoldschmucker99773 жыл бұрын
/* Created by Yvan / Brainy-Bits.com This code is in the public domain... You can: copy it, use it, modify it, share it or just plain ignore it! Thx! */ #include "AccelStepper.h" // Library created by Mike McCauley at www.airspayce.com/mikem/arduino/AccelStepper/ // AccelStepper Setup AccelStepper stepper(1,2,3); // 1 = Easy Driver interface // Nano Pin 2 connected to STEP pin of Easy Driver // Nano Pin 3 connected to DIR pin of Easy Driver // Variables to store current, previous and move position int val = 0; int previous = 0; int long newval = 0; void setup() { stepper.setMaxSpeed(200); // Set speed fast enough to follow pot rotation stepper.setAcceleration(100); // High Acceleration to follow pot rotation } void loop() { val = analogRead(A0); // Read Potentiometer current value if ((val > previous+10) || (val < previous-10)) { // Check that a move of the pot is at least > or < than 6 newval = map(val, 0, 1023, 0, 3200); // Map value (1600 = 1 stepper shaft rotation) stepper.runToNewPosition(-newval); // Move stepper to new position previous = val; // save current value into variable previous } }