Arduino Tutorial 30- Control DC Motor Speed and Direction using a Joystick
ฝัง
- เผยแพร่เมื่อ 9 ก.พ. 2025
- Let's use the PS2 Joystick to control a DC motor. So, this lesson helps you to create projects like robot cars, drones ...
● L298N Motor Driver: • Arduino Tutorial 29- C...
● Arduino Joystick: • Arduino Tutorial 16- H...
● Playlist Link: bit.ly/2VT2ZAN
Best Arduino Starter Kit 👇
✅ amzn.to/3TUro3o
--------------------------------------------------------------------
► Get Your First Arduino Starter Kit 👇:
✅ amzn.to/3VfGNM1
👉 amzn.to/3L7gPpw
♥ Don't Click This! : bit.ly/3jvI8g6
--------------------------------------------------------------------
FOLLOW ME:
● Facebook: / enjoymechatronics
● Github: github.com/Enj...
--------------------------------------------------------------------
► All content by Enjoy Mechatronics is 100% free. I believe that education should be freely available to everyone.
Best tutorial for controlling dc motor with joystick! I tried your code and it worked perfectly and it helped me understand the code a little better
Thanks, I appreciate it
The only video that worked for me tbh, thank you
No problem 😊
Brilliannt, thanks for the map function!
No worries!
Crystal clear explaining for beginners. Thanks
Thank you for the clarity
Any time!
Good job. I was thinking if you could use the Infrared in this project.
Saludos desde Colombia muchas gracias por compartir, gran explicación y trabajo
I have the same motor controller but mine came in a kit and it has click connectors instead of separate pins. WIll it still work for this project?
Thank you man, that was excellent 💓
My pleasure!
Code is not working
good project. in this project
how can I add potentiometer for speed control instead of joystick and also motor automatically reverse forward and delay cycle code change. please reply
Hey I wanted a help in unity 3d endless runner
I made multiple jump animations
Can I make unity play them randomly?
And how?
Which port we need to select?
Check out my first tutorial
I need this but with a roboclaw motor driver not the L298N
hi what value would I use if i wantef to use the y instead of the x
Just use the Ypin of the joystick 🕹
What kind of wire did you use to connect the motor to the l298n
Simple Jumper wires!
But it doesn't matter if you have different ones.
Can we control the same using a mobile Application with 4G module..??
dabble app
thanks
No problem
Hi, thank you for sharing, can you share the code please...Thank you
where is the code
which link is the code
Bro pls share the code man
int speedPin = 3;
int dirPin1 = 4;
int dirPin2 = 5;
int readPin = A0;
int readValue;
void setup () {
// put setup code here
pinMode (speedPin, OUTPUT);
pinMode (dirPin1, OUTPUT);
pinMode (dirPin2, OUTPUT);
pinMode(readPin, INPUT);
analogWrite(speedPin, 60);
digitalWrite(dirPin1, HIGH);
digitalWrite(dirPin2, LOW);
}
void loop () {
// put main code here
readValue = analogRead(readPin);
if(readValue < 400) {
analogWrite(speedPin, map(readValue, 0, 400, 255, 60));
//map(readValue, 0, 400, 255, 60);
digitalWrite(dirPin1, HIGH);
digitalWrite(dirPin2, LOW);
}else if(readValue
code ????
I relate to this
No me funciono la programación
Geeeeeniuuuus
Ajoyib