Arduino Tutorial 30- Control DC Motor Speed and Direction using a Joystick

Поделиться
HTML-код
  • Опубликовано: 22 сен 2024
  • 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.

Комментарии • 32

  • @deadlymedley3306
    @deadlymedley3306 2 года назад +5

    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

  • @MrKYT-gb8gs
    @MrKYT-gb8gs Год назад +3

    Brilliannt, thanks for the map function!

  • @soopengmingsoopengming146
    @soopengmingsoopengming146 2 года назад +1

    Crystal clear explaining for beginners. Thanks

  • @armelchiza3771
    @armelchiza3771 Год назад +1

    The only video that worked for me tbh, thank you

  • @mingosutu
    @mingosutu 9 месяцев назад +2

    Good job. I was thinking if you could use the Infrared in this project.

  • @The1Creston
    @The1Creston 9 месяцев назад +1

    Thank you for the clarity

  • @dr.saurabhipatkar5441
    @dr.saurabhipatkar5441 Месяц назад +1

    Code is not working

  • @HashbrownDestroyer
    @HashbrownDestroyer Год назад +1

    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?

  • @myidahohomestead.7123
    @myidahohomestead.7123 2 года назад +1

    I need this but with a roboclaw motor driver not the L298N

  • @m_som
    @m_som Год назад

    Thank you man, that was excellent 💓

  • @malikthetalentmaker6001
    @malikthetalentmaker6001 2 года назад +1

    Hey I wanted a help in unity 3d endless runner
    I made multiple jump animations
    Can I make unity play them randomly?
    And how?

  • @saisrinivas2056
    @saisrinivas2056 Месяц назад +1

    Can we control the same using a mobile Application with 4G module..??

  • @Chickennugget-vq6lw
    @Chickennugget-vq6lw Год назад +1

    hi what value would I use if i wantef to use the y instead of the x

  • @linalin2799
    @linalin2799 Год назад +1

    What kind of wire did you use to connect the motor to the l298n

    • @EnjoyMechatronics
      @EnjoyMechatronics  Год назад +1

      Simple Jumper wires!
      But it doesn't matter if you have different ones.

  • @malikthetalentmaker6001
    @malikthetalentmaker6001 2 года назад +1

    Geeeeeniuuuus

  • @Mr.P539
    @Mr.P539 Год назад +1

    Hi, thank you for sharing, can you share the code please...Thank you

  • @infinitylike5522
    @infinitylike5522 Год назад +1

    Ajoyib

  • @stevanardilaacero4785
    @stevanardilaacero4785 3 месяца назад +1

    No me funciono la programación

  • @AutoneticsProjectGalaxy
    @AutoneticsProjectGalaxy 4 месяца назад

    thanks

  • @mo135_cod2
    @mo135_cod2 2 года назад +2

    code ????

    • @fats1227
      @fats1227 3 месяца назад

      I relate to this

  • @ace.5162
    @ace.5162 5 месяцев назад +2

    Bro pls share the code man

    • @AldoHernandez-ou5mw
      @AldoHernandez-ou5mw 2 месяца назад

      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