Control Servo motor with push 2 buttons with Arduino SPB-4

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 พ.ค. 2024
  • In this video you will learn how to control a servo motor with push buttons. this video you will illustrate two mode.
    1-Using single push button the servo will move to the right and left
    2- Using two push button (left) and (right) the servo will move either to the right or left depending on which push button is pressed.
    ** Buy Servo Motor from **
    Amazon USA: amzn.to/3m6Cmkr
    Amazon Canada: amzn.to/2JdM5GK
    All Europe Amazon: amzn.to/36YDSzn
    AliExpress (single servo): s.click.aliexpress.com/e/_ApIWoQ
    AliExpress (4/5/20pcs metal gear): s.click.aliexpress.com/e/_AFMrG
    ** Purchase Arduino Start Kit **
    Amazon USA: amzn.to/3z88F9G or just UNO board amzn.to/3aY7KOL
    Amazon Canada: amzn.to/31an88J or just UNO board amzn.to/3pYxSNN
    Amazon Europe (all Europe): amzn.to/3pMCHge or Just UNO board amzn.to/2PgGItD
    AliExpress: s.click.aliexpress.com/e/_9uc7Xe
    Banggood: www.banggood.com/custlink/3GD... or UNO board www.banggood.com/custlink/vKm...
    eBay: ebay.us/B1JWLi
    ***** Purchase Authentic Arduino Uno from ***
    Amazon USA: amzn.to/2KApAwK
    Amazon Canada: amzn.to/37LZ8sW
    All Europe Amazon: amzn.to/36YDSzn
    Go directly to a section of this video:
    00:00 Start
    00:50 Wiring Explained
    02:29 Code explained for single button
    05:44 Demo of controlling servo with single button
    06:26 Code explained for two buttons
    10:18 Demo of controlling servo with Left and Right buttons
    Download the code for servo push button: robojax.com/L/?id=272
    Learn Arduino in 30 Minutes (video): robojax.com/L/?id=135
    Related videos:
    Move Servo and Return SPB-1 : • Control Servo motor wi...
    Move Servo to ONE direction SPB-2: • Control Servo motor wi...
    Move Servo Keep push button pressed SPB-3: • Control Servo motor wi...
    Control Servo with potentiometer: • Lesson 85: Control Ser...
    Control 2 Servo with 2 potentiometer: • How to control 2 Servo...
    Control Servo with hand gesture: • How to control servo w...
    Control 16 Servo Motors: • Complete guide to PCA...
    ** Buy Servo Motor from **
    Amazon USA: amzn.to/3m6Cmkr
    Amazon Canada: amzn.to/2JdM5GK
    All Europe Amazon: amzn.to/36YDSzn
    ** Purchase item **
    Amazon USA
    - Arduino UNO(authentic): amzn.to/3glHgYp
    -Arduino Mega(authentic): amzn.to/33P5sO1
    -Arduino Nano (authentic): amzn.to/3onbH3s
    - Arduino UNO(compatible): amzn.to/3ghPnp9
    -Arduino Mega(compatible): amzn.to/3lXizTG
    -Arduino Nano (compatible): amzn.to/3n3s5FO
    Amazon Canada
    - Arduino UNO(authentic): amzn.to/3qtwzrw
    -Arduino Mega(authentic): amzn.to/36NwOpI
    -Arduino Nano (authentic): amzn.to/39NPveJ
    - Arduino UNO(compatible): amzn.to/36QA5ok
    -Arduino Mega(compatible): amzn.to/36QA5ok
    -Arduino Nano (compatible): amzn.to/36NwOpI
    Learn Arduino in 30 Minutes (video): robojax.com/L/?id=135
    Tutorial by Ahmad Shamshiri form Canada
    ****************************
    Arduino Step by Step Course (over 100 lectures) Starts here • Lesson 00 What is Ardu...
    ****************************
    If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robojaxTV
    Follow me on Facebook robojaxTV
    Follow me on Twitter: / robojaxtv
    Follow me on Instagram: / robojax
    Tutorial by Robojax.com
    Get other projects code and learn Arduino
    robojax.com/learn/arduino
    *** AFFILIATE PROGRAM ***
    We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
    #robojax #robojaxServo
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 148

  • @mohammaddalbah170
    @mohammaddalbah170 5 ปีที่แล้ว

    Thank you so much for making this video. Well explained!

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome.

  • @jktphotography990
    @jktphotography990 3 ปีที่แล้ว

    thank you,i made this project with 4 servo motor using this method and it worked really well!!

    • @robojax
      @robojax  3 ปีที่แล้ว

      Glad it helped

    • @avnishrai01
      @avnishrai01 3 ปีที่แล้ว

      bro can you tell me how you added 4 servo plz

  • @javierpallalorden
    @javierpallalorden 6 ปีที่แล้ว

    Nice video, thanks for the clear explanation.

    • @robojax
      @robojax  6 ปีที่แล้ว

      You are welcome.

  • @infinytower3317
    @infinytower3317 5 ปีที่แล้ว +3

    Please show us how to use buttons or 3x4 numeric keypad to control 16 servos!

  • @arghyadas5789
    @arghyadas5789 3 ปีที่แล้ว

    You are the only solution for all my problems ...hahaha ...thank you so much sir ...love from india

    • @robojax
      @robojax  3 ปีที่แล้ว

      you are welcome. Don't forget to subscribe. thanks

  • @George-yr3xv
    @George-yr3xv 4 ปีที่แล้ว

    thank you for the video, very helpful

    • @robojax
      @robojax  4 ปีที่แล้ว

      You are welcome. Thank you for not skipping the ads and keep watching it. This will help me a lot.

  • @cndbrn7975
    @cndbrn7975 2 ปีที่แล้ว

    I only have spst (2 pin) rocker switches, so every tutorial on how to make dc motors go f @ r is with dpdt or with at least 3 pins. Or a bunch of relays, transistors or 4 switches to make an H-bridge. I'm going to try this method and I'll let you know how it works out. Thanks!

  • @danielst7291
    @danielst7291 5 ปีที่แล้ว

    Awesome! Very helpful

    • @robojax
      @robojax  5 ปีที่แล้ว

      Thank you.

  • @gregory8017
    @gregory8017 3 ปีที่แล้ว

    thank you for the help!!

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      You are welcome. Please subscribe. I appreciate it and helps my channel grow. Thank you

    • @gregory8017
      @gregory8017 3 ปีที่แล้ว +1

      @@robojax sure, new follower!!

  • @kuztomix
    @kuztomix 5 ปีที่แล้ว

    Thanx Robojax!

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome.

  • @qwertyproductions4109
    @qwertyproductions4109 5 ปีที่แล้ว

    really nice and helpfull video

    • @robojax
      @robojax  5 ปีที่แล้ว

      Thank you.

  • @RexSclavorum1
    @RexSclavorum1 ปีที่แล้ว

    Hello Ahmed Thanks for the advice in the other videos. the power supply with batteries for the nano and the servo motor works perfectly. Now I would like to ask you how I can move the servo to the right with just one click and to the left with just one click. as in this video with two buttons.

    • @robojax
      @robojax  ปีที่แล้ว

      Hello, see my other video as I have such video

  • @user-fo8sz2ym4u
    @user-fo8sz2ym4u 8 หลายเดือนก่อน

    I would like to run a few brushless motors and servos using if and else statements from the same Arduino Mega board making use of a push button. How would I go about doing that?

    • @robojax
      @robojax  8 หลายเดือนก่อน

      You will need Elecyronics speed controller or ESC to control ruthless motors.

    • @user-fo8sz2ym4u
      @user-fo8sz2ym4u 8 หลายเดือนก่อน

      I have that no problem . My question is would I be able to?
      @@robojax

  • @madhukeshnp
    @madhukeshnp 6 ปีที่แล้ว

    Ur just cool n awesome. Thank u for the tutorial.
    Can we add a reset button to return the position to zero degree ?

    • @robojax
      @robojax  6 ปีที่แล้ว +2

      You are welcome. Yes you can.
      Define reset button (as RES) the same as LEFT and RIGHT. in setup do the same
      then if (digitalRead(RES )==LOW)
      {
      myservo.write(angle);
      }
      Angle is the variable you define at initial step value.

    • @madhukeshnp
      @madhukeshnp 6 ปีที่แล้ว

      Robojax thank you so much for your quick reply. I will try and let you know.

    • @madhukeshnp
      @madhukeshnp 6 ปีที่แล้ว

      /*
      Controlling a servo with two Push buttons with Arduino
      when Left push button is pressed, the servo start moving to the left until it reaches 180( or zero) degrees
      when Right push button is pressed, the servo start moving to the right until it reaches 180( or zero) degrees
      At any instance if the button is released, servo stops
      May 22, 2018 at 01:00
      Written by Ahmad S. for Robojax.com at Ajax, Ontario, Canada
      Watch video for this code at th-cam.com/video/7woqNH_qby4/w-d-xo.html
      This code is taken from robojax.com/learn/arduino
      */
      #include
      Servo myservo; // create servo object to control a servo
      int angle =90; // initial angle for servo
      int angleStep =5;
      #define LEFT 12 // pin 12 is connected to left button
      #define RIGHT 2 // pin 2 is connected to right button
      #define RES 3 // pin 3 reset
      void setup() {
      // Servo button demo by Robojax.com
      Serial.begin(9600); // setup serial
      myservo.attach(9); // attaches the servo on pin 9 to the servo object
      pinMode(LEFT,INPUT_PULLUP); // assign pin 12 ass input for Left button
      pinMode(RIGHT,INPUT_PULLUP);// assing pin 2 as input for right button
      pinMode(RES,INPUT_PULLUP); // assign pin 3 as reset button
      myservo.write(angle);// send servo to the middle at 90 degrees
      Serial.println("Robojax Servo Button ");
      }
      void loop() {
      // Servo button demo by Robojax.com
      while(digitalRead(RIGHT) == LOW){
      if (angle > 0 && angle = 0 && angle 180){
      angle =180;
      }else{
      myservo.write(angle); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle); // print the angle
      Serial.println(" degree");
      }
      }
      if (digitalRead(RES)==LOW)
      {
      myservo.write(angle);
      }
      }

      delay(100); // waits for the servo to get there
      } ///// the code compiles but not sure if it works as it should. Please help me out with this. I am not able get hold of a servo right now. so can you please help me out with this ?
      Thank you in advance.

  • @tjweaver3637
    @tjweaver3637 3 ปีที่แล้ว

    Great video and explanation. I have been looking for a solution using two buttons for a model railway turnout. Is there a way setting it to go directly to an angle with one button and then back again with the other button? I have seen it using a command called throw?

    • @robojax
      @robojax  3 ปีที่แล้ว

      I have so many videos on servo and I am sure one will work for you or watch and learn and combine two of them. here is the link th-cam.com/users/RobojaxTVsearch?query=servo or just search my channel for the word "servo"

    • @DrFrankensteam
      @DrFrankensteam 2 ปีที่แล้ว

      Oh dang! That’s why I’m here! Lol!

  • @fotiosvakakis1723
    @fotiosvakakis1723 2 ปีที่แล้ว

    Is there a way to make this work after removing the wires/making the wire distance longer?

    • @robojax
      @robojax  2 ปีที่แล้ว

      If you are referring to push button switch wire, yes you can extend it with shielded with to 100m and with unshielded wire perhaps to 2 minutes I 3m depending on environment and type of wire.

  • @JK-lq4ru
    @JK-lq4ru 2 ปีที่แล้ว

    hi, great video! I wanted to know whether the 2 button code would remain the same if I used an external power source for the servo, like a 6V battery, attached by wires to the breadboard? Please could you also upload a clear wire diagram for the set up of 2 buttons?

    • @robojax
      @robojax  2 ปีที่แล้ว

      Wrong video. If you follow my course you would know it. This is way advanced comparing to basic servo control

    • @robojax
      @robojax  2 ปีที่แล้ว

      See the lecture from my Arduino Step by Step course th-cam.com/video/J_kbyAY1rLM/w-d-xo.html

    • @JK-lq4ru
      @JK-lq4ru 2 ปีที่แล้ว

      @@robojax thank you for your help, I shall check the video :)

  • @jcummings3215
    @jcummings3215 4 ปีที่แล้ว

    Watched your video and my project works the same as yours. I could use your help and experience as I am very new to working with Arduino. I would like to know how to control two servos, each with two buttons.

    • @robojax
      @robojax  4 ปีที่แล้ว

      Please see my all videos on servo here and you will find something that will work for your application th-cam.com/channels/kcBSig_Iu4ZnAIeCeG1TVg.htmlsearch?query=servo

  • @heresjhonny702
    @heresjhonny702 ปีที่แล้ว

    Hi, how can i do this but: the buttons act as toggles and button1 set it to stay at 0 degrees and the button 2 to 90 degrees?

  • @solarnjtc
    @solarnjtc 4 ปีที่แล้ว

    Hey Robo jax, great vids. However I'm losing my mind as to how to do this with the 16channelpwm drivers. I'm sure you're busy but if you can point me in the right direction thatd be great. Thanks again

    • @robojax
      @robojax  4 ปีที่แล้ว

      Hi, why are you trying this code which is for 1 servo motor and using it for 16 channel? Search my channel for 16 channel th-cam.com/channels/kcBSig_Iu4ZnAIeCeG1TVg.htmlsearch?query=pca9685

  • @briandorning4537
    @briandorning4537 4 ปีที่แล้ว +1

    Thank you for the video. Very helpful. Can you help me please, I need a servo to cycle from 0 degrees to 180 and then back, when a button is pressed. So, when I press a button, the servo will go from 0 degrees, to 180, then back to 0.

    • @robojax
      @robojax  4 ปีที่แล้ว +1

      You are welcome. Can you tell me why you need? what kind of application requires that? I will make video on that if I find it useful.

    • @briandorning4537
      @briandorning4537 4 ปีที่แล้ว

      Thank you for your reply sir.
      I want to build a machine like this th-cam.com/video/slg8Mn1qwE4/w-d-xo.html
      But I want my machine to be electronic vs mechanical.

  • @reorodgers9970
    @reorodgers9970 3 ปีที่แล้ว

    Hello, great video. I'm wondering if you could help me. I'm trying to figure out a way to press the button once (not hold the button) and have the servo move from 0 degrees to 180 degrees, delay for 5 seconds and then return to 0 degrees. Any suggestions?

    • @robojax
      @robojax  3 ปีที่แล้ว

      Search my channel. I have so many set it related videos. Watch, learn and write your own code. It is impossible to satisfy everyone’s need. I have explained them fully. So watch 2, 3, r or 5 times until you learn it and write your own code. Good luck

  • @modelSUB
    @modelSUB 6 ปีที่แล้ว

    Hello Robojax and thanks for your interesting video. Please I have a question for you about another video you made (Sound module ISD1820) Please can you tell us what is the potentiometer value and how to connect to the ISD1820 sound device and match the audio level? A schematic drawing wiil be very well received. Many thanks again and have a nice day!

    • @robojax
      @robojax  6 ปีที่แล้ว

      Hello and welcome. would you please post your question here th-cam.com/video/IfK8z_o5vbk/w-d-xo.html so I replay?

    • @modelSUB
      @modelSUB 6 ปีที่แล้ว

      Hi Robojax and thanks for your kindly reply. Yes I made this question in the video about ISD1820 sound device you say me. I will be very grateful if you could answer my questions there. Thanks for your help and have a great day!

    • @manuelbenaventemoreno7313
      @manuelbenaventemoreno7313 6 ปีที่แล้ว

      Yes I posted there my question. Please I will be very grateful if you could answer me there, Thx!

  • @donj03an
    @donj03an 3 ปีที่แล้ว

    Nice video.....can it use for motorcycle gear selector ?

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      Yes, definitely

    • @donj03an
      @donj03an 3 ปีที่แล้ว

      @@robojax motor respon time need adjusment, right?

  • @qwertyproductions4109
    @qwertyproductions4109 5 ปีที่แล้ว

    Thanks

  • @ahmadabbass9599
    @ahmadabbass9599 3 ปีที่แล้ว

    does this work for a winding and measuring system project if i use this code for the motor? or its different for all proejcts

    • @robojax
      @robojax  3 ปีที่แล้ว

      this code is about controlling a servo motor. if you use servo motor, then it will work.

  • @daryl7237
    @daryl7237 2 ปีที่แล้ว

    hi do you any video Control Servo motor with push 2 buttons with OLED display?
    Anyway nice video it's help thank you for sharing

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Hi, please search my channel . Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo

  • @daryl7237
    @daryl7237 2 ปีที่แล้ว

    hi there! possible to change the function not go back to 0 every time start up?

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Hi, yes it is possible.
      I have mode so many videos on Servo. if you watch few of them, you will for sure learn. Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo

    • @daryl7237
      @daryl7237 2 ปีที่แล้ว

      @@robojax hi there thanks for your reply! i will try to learn it! i never touch programing before :-)

  • @hariwenkat
    @hariwenkat 3 ปีที่แล้ว

    Sir Ahmad ,can you please explain how to modify the program if ONE MORE SERVO is added in order to execute the same action (turning to certain deg and returning to same position when the pushbutton is released)

    • @robojax
      @robojax  3 ปีที่แล้ว

      Hi, I have separate video for multiple servos. Check all videos on Servo here th-cam.com/users/robojaxTVsearch?query=servo

  • @calgalan3810
    @calgalan3810 5 ปีที่แล้ว

    Hello Robojax, would you please show me how to increase coding from 1 servo to 6 , I find your videos very interesting, thank you.

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome. I will make video on that but you can get the idea from this video th-cam.com/video/c90NszbNG8c/w-d-xo.html

    • @calgalan3810
      @calgalan3810 5 ปีที่แล้ว

      @@robojax Thank you very much, I´ve watched the video and will try to see if I can make any progress, if I cannot I shall wait for your next video, thank you again.

  • @pieterfouche6931
    @pieterfouche6931 4 ปีที่แล้ว

    Halo, awesome video, I do have some questions, I want to use 4 servos each using 2 buttons, what I'm experiencing is my servos are conflicting, I have define each button to a pin and servo would it because all my servos are on one ground to the arduino? And maybe can you leave a example to use 2 servos on 4 buttons I just want to make sure I'm correct with the code I'm using if you don't mind?

    • @robojax
      @robojax  4 ปีที่แล้ว

      Hello, Thank you. Please post your code in this page codeshare.io/29njmB and I will look at it.

    • @pieterfouche6931
      @pieterfouche6931 4 ปีที่แล้ว

      @@robojax ah thanks man I managed to sort it out it was in the code, keep an eye out will post soon

    • @vishalragi9144
      @vishalragi9144 4 ปีที่แล้ว

      @@pieterfouche6931 hey man it would really be helpful if you could provide me with your code because even I want to use 4 servos each using 2 push buttons. I want it for a college project.

  • @maciejkozyra9968
    @maciejkozyra9968 3 ปีที่แล้ว

    Good morning what is cheapest arduino board to control servo by two buttons? Is it need servo controller like pololou micro?

    • @robojax
      @robojax  3 ปีที่แล้ว

      Arduino is already $3 or $4 on aliExpress where you get it in 30 to 60 days with free shipping. any arduino can work with servo.

  • @calgalan3810
    @calgalan3810 5 ปีที่แล้ว +1

    Good afternoon Robojax,, after watching the video "dual button to control micro servo" I have tried to modify code to allow me to control six servos individualy, twelve buttons, unfortunately
    I'm failing miserably. I would be most thankful for any help I could get to get this write so I can get my trains going Thank you very much.

    • @robojax
      @robojax  5 ปีที่แล้ว +2

      I was on vacation for 2 weeks. Replaying now. I would have to make video and write/test code which needs time. I will put it on my "to do " list.

  • @MercXLR8
    @MercXLR8 3 ปีที่แล้ว

    What would I have to add to the code if I wanted to have the servo only move the determined increment no matter if the button is quickly pushed or held down. Currently if I hold the button down the servo continues to move.

    • @robojax
      @robojax  3 ปีที่แล้ว

      See the links to other codes in description. Or search and I am sure if you watch them, you will learn and customize them for your need

  • @pzpl8867
    @pzpl8867 2 ปีที่แล้ว

    Hello i have a problem.
    I have 2 buttons and one start move servo, but second should stop this moving. How can i stop servo moving?

  • @sonaryimapy
    @sonaryimapy ปีที่แล้ว

    Mr Robojax is it possible to prepare software to sevro control with features: power on- go to 0 , push button(non momentary button) - servo start moving with pre loaded anlge, delay ( pause time as add setting), servo stop- delay( pause time as add setting). Just servo moving in loop (0-45 degree )with paused. Is it posible to get 3 different speed via second button?( Micro 6 Pololou controler possible)What is price of it - if You're agree to do something like that. Regards.

    • @robojax
      @robojax  ปีที่แล้ว

      Hello, I did not get it properly. The best way to explain it is to use machine state diagram something like this snipboard.io/IgYnWr.jpg and contact me via Robojax.com contact page. Please provide your email address in the message. I will charge $75/hour.

  • @erikslan
    @erikslan ปีที่แล้ว

    hello! i am trying to move between two specific degrees, 155 to 180. i have tried changing the degrees in the code but it causes it not to work. is there a way to adjust the code so i am moving the servo less?

    • @robojax
      @robojax  ปีที่แล้ว

      Hi, that's exactly what I have written he code for. you must have changed the code. start with the fresh code and pay attention to const int minAngle = 0; const int maxAngle = 180;. Or check tones of other code for servo that I have on this page robojax.com/learn/arduino/

  • @behroozmazlom
    @behroozmazlom 4 ปีที่แล้ว

    thanks for helping us!
    ahmad i need a code to work a servo with just one buttone when push and release the buttone the servo go to 90 degree and back to 0 degree! i believe it is simple code but im just new to arduino so can you please help me? thank you so much ahmad

    • @robojax
      @robojax  4 ปีที่แล้ว

      You are welcome. You haven't subscribed to my channel. The best thank you for me is to subscribe to my channel and thumb up the video. It is greatly appreciated. 🔔 😊
      I will make video. Make sure to subscribe so you get notefied.

    • @behroozmazlom
      @behroozmazlom 4 ปีที่แล้ว

      @@robojax i subscribed already!! can you just help me with simple code thanks!!

  • @lanceceellot5572
    @lanceceellot5572 3 ปีที่แล้ว

    i notice you have to codes for this video, can you combine it in one using another button to choose code 1 and code 2? thanks

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      I've fully explained the code, if you watch it carefully, you can combine them. I've tones more videos on servo motors you may find what you want. here is search result th-cam.com/users/RobojaxTVsearch?query=servo

    • @lanceceellot5572
      @lanceceellot5572 3 ปีที่แล้ว

      @@robojax thank you so much

    • @robojax
      @robojax  3 ปีที่แล้ว

      you are welcome.

  • @rajeshrai697
    @rajeshrai697 4 ปีที่แล้ว

    Sir for controlling the movement of 7 servos using 4 buttons. How the connections will be done?

    • @robojax
      @robojax  4 ปีที่แล้ว

      If you watched my video. I never leave any details. You will need to define extra pins for push butts and extra pins for servo and add the rest of the code. It should work. Watch the video again without escaping.

  • @a.manan.s846
    @a.manan.s846 5 ปีที่แล้ว

    in the 2 button coding, i want the servo to go back onto its initial position which is 90 if we release a push button, so can you tell me that what do i do. or if you can make a video on this topic so this will be very great.

    • @robojax
      @robojax  5 ปีที่แล้ว

      I have got a video showing how to control servo motor using Infrared Remote controller. You can use the code if you know how to modify it. th-cam.com/video/Wp7hX9UErSQ/w-d-xo.html

    • @auratoxic8707
      @auratoxic8707 4 ปีที่แล้ว

      I tried to understand that code but was not able to understand please tell us how to do it , please make a code for this problem please

  • @HSoto-dd7hj
    @HSoto-dd7hj 4 ปีที่แล้ว

    Can you change the int angle = 90 to start from where ever it’s location is at that moment?

    • @robojax
      @robojax  4 ปีที่แล้ว

      yes. I have explained this in the video. Change it to any value between 0 to 180.

    • @HSoto-dd7hj
      @HSoto-dd7hj 4 ปีที่แล้ว

      Robojax but setting it at any value between 0-180 will set that servo at that value when restart. For example, if I leave the servo at 75 degrees (or any other random degree)I would like the servo to stay at that position when I restart it and not at the set value. Hope that makes sense.

    • @robojax
      @robojax  4 ปีที่แล้ว

      sorry I did not get what you want to say. Setting value and "staying at that position" isn't the same if you don't push any button, it will be the same.

    • @HSoto-dd7hj
      @HSoto-dd7hj 4 ปีที่แล้ว

      Robojax lol nvr mind

  • @pauldoore1255
    @pauldoore1255 2 ปีที่แล้ว

    Hi, I am completely new to this and I am starting from knowing nothing. How does copy and paste work when trying to copy the code into the IDE. Each time I have tried and then compiled the sketch quite a few errors occur and the upload will then fail. any advise you could give would be greatly appreciated

    • @robojax
      @robojax  2 ปีที่แล้ว

      Hello, please watch this 30 minutes course th-cam.com/video/Mbb2xa1WcRM/w-d-xo.html

  • @Angelsp1112
    @Angelsp1112 4 ปีที่แล้ว

    hey im using the code with a continuous servo (360) and even if i release the buttons it keeps moving, how can i make it stop when i stop pressing the buttons? i thought about setting the input without pullup and using a resistor but im not sure.

    • @robojax
      @robojax  4 ปีที่แล้ว

      I have separate video for that th-cam.com/users/robojaxTVsearch?query=360

  • @arghyadas5789
    @arghyadas5789 3 ปีที่แล้ว

    What changes I need to make in code for makeing it like, once the left button is pushed servo should move left then again automatically come back to 90 degree when there is no input applied ...PLZZ help

    • @robojax
      @robojax  3 ปีที่แล้ว

      the possibilities are endless for what each user want. I have created so many videos which you may find one of then useful or watch, learn and customize them. here are the videos th-cam.com/users/RobojaxTVsearch?query=servo

  • @joelvincentduerme8515
    @joelvincentduerme8515 2 หลายเดือนก่อน

    what would be my power supply for the servo motor

    • @robojax
      @robojax  2 หลายเดือนก่อน

      didn't I show it? it is 5V if you use the type of servo motor show in the video. Elese the manufacturer should provide the manual for the servo.

  • @extremeproductions4482
    @extremeproductions4482 2 ปีที่แล้ว

    Hello sir can you please tell me how I can control 4 servo motors with one arduino
    thankyou

    • @robojax
      @robojax  2 ปีที่แล้ว

      Hi, I mentioned everything in this code. See the same video which is part of my Arduino course in this channel where you will see better details and wiring diagram. Simply define a push button pin for 2nd and 3rd servo, and the. Same for servo and all variables I mention in code . For example we have variable called “angle” in the code in this video, then you create new variable called angle2 for 2nd servo and angle3 for third. Or start learning Arduino from here th-cam.com/play/PLHvJ4bw0xno4Z3FC2W07I4D2UP14bOaT2.html

  • @cy5p89e4g1a
    @cy5p89e4g1a 4 ปีที่แล้ว

    RJ, thank you for sharing. I'm trying to play around with the anglestep, going from 5 to 10 to speed up the rotation, but when I compile and upload, the buttons become unresponsive. The monitor shows the step have increased, but the servo doesn't move anymore. When I go back to 5 steps, all works. Seems nothing outside 5 steps is working for me? Any ideas?

    • @cy5p89e4g1a
      @cy5p89e4g1a 4 ปีที่แล้ว

      Just had a thought...I pushed the button and then manually gave the servo arm a nudge, and it worked. I heard that some higher torque servos should be run with power supply separate from the Arduino. I think that may be the problem.

    • @cy5p89e4g1a
      @cy5p89e4g1a 4 ปีที่แล้ว

      No, still sluggish or unresponsive at times. Maybe the breadboard? Do you have any sluggishness when you run the program?

    • @robojax
      @robojax  4 ปีที่แล้ว

      I belive it is your servo itself. Try printing the values on the serial monitor. If it prints properly, then the servo is bad or bad wiring

    • @cy5p89e4g1a
      @cy5p89e4g1a 4 ปีที่แล้ว

      @@robojax Values are printing properly. I suspect the wiring and will redo it with a different board and components. Thank you for this and getting back to me so fast. Subscribed.

    • @robojax
      @robojax  4 ปีที่แล้ว

      You are welcome and thanks for subscribing.

  • @thehorse169
    @thehorse169 5 ปีที่แล้ว

    cant seem to get it to work rx led flashes when buttons are pressed but servo does not move, checked servo with tester and works ok (sweeps, centers and moves when pot is turned) any help would be appreciated TIA

    • @robojax
      @robojax  5 ปีที่แล้ว

      You have selected a pin that is not PWM. you must select a digital with with ~ sign like 3, 6, 7, 9 or 11 in Arduino Uno.

    • @thehorse169
      @thehorse169 5 ปีที่แล้ว

      @@robojax thanks for reply found the problem it was poor ground on the breadboard have now soldered connections without bb and all works a treat , now got to figure out how to construct lever mechenism for daughters cosplay suit
      Thanks again for help

  • @juanmarmol1989
    @juanmarmol1989 5 ปีที่แล้ว +2

    I need help, I've tried everything and it wont work, I used tinkercad to be safe and nothing happened. It's like it never reads void loop. I did copy paste in the code and the wiring and still doesnt work.

    • @robojax
      @robojax  5 ปีที่แล้ว

      Then you have to check this video th-cam.com/video/kZ9b31gVemc/w-d-xo.html and also code from Arduino open File->Examples->Servo-Sweep and if then watch th-cam.com/video/2WwedCRwmgA/w-d-xo.html to learn how Push button work. Good luck

    • @minecraftvideos3435
      @minecraftvideos3435 4 ปีที่แล้ว

      Same but the wiring doesn’t work

  • @hungnguyen-yn1io
    @hungnguyen-yn1io 3 ปีที่แล้ว +2

    Rất hay

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      Thật tốt khi nghe điều đó.

  • @mcb9644
    @mcb9644 4 ปีที่แล้ว +1

    Can it turns more than 180 degrés

    • @robojax
      @robojax  4 ปีที่แล้ว

      No it can't. Here 360 servo th-cam.com/video/b_xvu6wWafA/w-d-xo.html

  • @minecraftvideos3435
    @minecraftvideos3435 4 ปีที่แล้ว

    Do you have to use that bread board

    • @minecraftvideos3435
      @minecraftvideos3435 4 ปีที่แล้ว

      Like that circuit board

    • @robojax
      @robojax  4 ปีที่แล้ว

      If you can connect them without breadboard no you don't need it.

    • @minecraftvideos3435
      @minecraftvideos3435 4 ปีที่แล้ว

      Thank u for help and really fast replies

    • @minecraftvideos3435
      @minecraftvideos3435 4 ปีที่แล้ว

      I kept making this and making sure it was correct but it won’t work for me can I have help please

  • @kaismaskcostumes8056
    @kaismaskcostumes8056 4 ปีที่แล้ว

    Can you help me with your one button code to make one servo go from 0-180 and the other servo go from 180-0 at the same time

    • @robojax
      @robojax  4 ปีที่แล้ว

      Interesting point. I would have to work on it and make video. But not so soon. I will put it on my list.

  • @zareenali6127
    @zareenali6127 4 ปีที่แล้ว

    Can i use 4 servo motors

    • @robojax
      @robojax  4 ปีที่แล้ว

      Yes. you can. You would have to define pin for 4 servo and 4 push buttons. Interesting.

  • @3dprintingtoday
    @3dprintingtoday 3 ปีที่แล้ว +1

    i keep on getting this when i try to upload it Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"
    Sketch uses 3750 bytes (11%) of program storage space. Maximum is 32256 bytes.
    Global variables use 271 bytes (13%) of dynamic memory, leaving 1777 bytes for local variables. Maximum is 2048 bytes.
    avrdude: ser_open(): can't set com-state for "\\.\COM3"
    An error occurred while uploading the sketch
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      it means wrong port is selected with your arduino or it is not connected. it is very essay. when you see "can't set com-state for "\\.\COM3"" you should always check the port or usb cable. or Learn Arduino in 30 Minutes (video): robojax.com/L/?id=135

    • @3dprintingtoday
      @3dprintingtoday 3 ปีที่แล้ว +2

      @@robojax thank you so much

    • @3dprintingtoday
      @3dprintingtoday 3 ปีที่แล้ว +2

      @@robojax I’m super happy and hope your channel grows because you have many things to do in your life and you care about your channel so much you reply to everyone unlike all those people that just lie you deserve to blow up with your channel!

    • @robojax
      @robojax  3 ปีที่แล้ว +2

      Thanks for your well wishes, I have patience and if people don’t see it, God the almighty can see . Stay safe

  • @computerjantje
    @computerjantje 5 ปีที่แล้ว

    why do we not need a resister? I see always resistors when arduino is used with push buttons. I don't get it.

    • @robojax
      @robojax  5 ปีที่แล้ว

      because the input pin must have a state either HIGH or LOW. Push button when not pushed is not connected and the input pin will not be connected and this will cause unknown input value and as a result unknown output or result will occur. So we use a resistor when the button is not connected, using the resistor the input pin is either HIGH or LOW depending on how you connect the resistor.

  • @thinkdo9735
    @thinkdo9735 5 ปีที่แล้ว

    Hello Robojax and Thanks for that amazing and very helpful video. I have a i make a codes for (RFID MFRC522) that is working good i can accesses with card from outside but i want to use same three'd meathead in my file also because of i can't accesses from inside please help me out. I will be very Thankful to you.

    • @robojax
      @robojax  5 ปีที่แล้ว

      I have this MFRC522 module on my "to do" list. what do you mean can't access from "inside". you man from within Arduino?