How to control Stepper Motor using a Joystick ( Easy Driver )
HTML-код
- Опубликовано: 6 сен 2024
- This video is aboutHow to control Stepper Motor using a Joystick ( Easy Driver ) , an Arduino and the Easy Driver
Parts list
- Arduino UNO R3
- Easy Driver
- Stepper Motor NEMA17
- Joystick Module
- PC Power supply
- Breadboard
- Jumper Wires
Arduino Sketch : goo.gl/V1Pszy
::::::::::: SUPPORT CHANNEL ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Please Donate To Help Me Afford New Equipment And Software To Make My Videos More : goo.gl/1m8Dg2
Don't forget to subscribe!
We Are One by Vexento / vexento
/ vexento
Music promoted by Audio Library • We Are One - Vexento (...
I transcribed the code
. Here it is but I don't know what it says on line #1. it worked for me
#
#define stp 2
#define dir 3
#define MS1 4
#define MS2 5
#define EN 6
//Declare variables for functions
char user_input;
int x;
int y;
int state;
int joyX = A0;
int joyVal;
void setup() {
pinMode(stp, OUTPUT);
pinMode(dir, OUTPUT);
pinMode(MS1, OUTPUT);
pinMode(MS2, OUTPUT);
pinMode(EN, OUTPUT);
digitalWrite(stp, LOW);
digitalWrite(dir, LOW);
digitalWrite(MS1, LOW);
digitalWrite(MS2, LOW);
digitalWrite(EN, HIGH);
Serial.begin(9600); //Open Serial connection for debbuging
}
//Main loop
void loop() {
while( (analogRead(joyX) == 0 ) || (analogRead(joyX) > 1000)){
joyVal = analogRead(joyX);
digitalWrite(EN, LOW);
if( joyVal == 0){
digitalWrite(dir, LOW);
}
else if(joyVal > 1000){
digitalWrite(dir, HIGH);
}
digitalWrite(stp,HIGH); //Trigger one step forward
delay(1);
digitalWrite(stp,LOW); //Pull step pin low so it can be triggered again
delay(1);
} // while loop
digitalWrite(EN, HIGH);
}
First line is #define Y_pin A0 or #define X_pin A0 depends on axis that you want to use with joyistick :)
Just play the video at 2x speed and it's watchable
Thank you for the tutorial. Great stuff.
Redirected after clicking on "Arduino Sketch" and code appears to be inaccessible. Curious about modifying the run two or three steppers using two joysticks. Two could be run on a single joystick, and the other on a second joystick.
Yes I would also like to run 3 steppers with 2 joysticks any chance I could get some help with the code?
Yes! Have ou tried this yet? Been trying to find the code for this and I'm having ZEEERO luck.
Thanks for the video, what program do you use to draw the wiring schematics?
it´s called fritzing
Is it possible to store movement of joystick and run and re-run all day?
como baixo o Arduino sketch?
see mutch easier then the uln2003 great work
Thumbs down because Arduino sketch website leads to a sketchy, unrelated website.
Is there any reason you chose those pins for the easy driver? I would like to use two motors controlled separatly by a joystick, is this possible? Thanks!
You would need 2 easydriver boards but only one joystick. Up/down could control one and right/ left the other. You could also wire ms1, ms2, and enable from both motors to the same pins on the arduino.
May I ask what program you use to make the arduino diagram with? And very good video Thanks
Fritzing
Nice one again
Thanks for the video. I'm hoping to make a camera slide like that as a future project...(so many projects, so little time)
@hillsbottom It's still on my to do list. I did get some parts, so hopefully soon...
👍👏
Erkan Okman denediniz mi ?
code?
👍
hi
send me your source code, please
😘