Control Servo motor with a Push Button: Move Servo to ONE direction SPB-2

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 พ.ค. 2024
  • Step by step learn how to control servo by pressing a push button to move it in ONE direction either from 0° to 180° or from 180° to 0° or any other angle you chose.
    The best thank you for me is to not to skip ads and Subscribe 🔔 to my channel, like 👍 the video It is greatly appreciated. 🔔 😊.
    I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe and enable the bell 🔔.😊
    ** 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
    Download code for this video: robojax.com/L/?id=103
    00:00 start
    00:40 Introduction
    04:00 Wiring Explained
    05:13 Code Explained
    11:22 Demonstration
    Related videos:
    SPB-1 Servo With Push button Video 1 : • Control Servo motor wi...
    Why we need resistor with push button: • Why use Resistors with...
    ***** Purchase Authentic Arduino Uno from ***
    Amazon USA: amzn.to/2KApAwK
    Amazon Canada: amzn.to/37LZ8sW
    ** 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
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @alexmachado3176
    @alexmachado3176 4 ปีที่แล้ว +3

    Been looking for this code demo for a long time... Well done thank you!

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

      You are welcome.

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

    Thank YOu Bro. Love it.

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

    thanks for your vids. GREAT.

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

      My pleasure!

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

    Nice and very useful tutorial.
    thanks to you

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

      You are welcome.

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

    Thank you for all your videos. I have downloaded this sketch and it is exactly what I want. I am building a mimic panel for my railroad, I have 6 servos operating 6 turnouts and would like to control them with 6 pushbuttons. I would be grateful if you could modify the sketch for 6 servos, Regards, Wally.

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

    I'm still waiting the 32 servo control with 1 arduino 😜 Man you saving my life so much, I just need that tutorial 😍 Please do it and u save 1 life ehehehe Thanks for your help

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

      32 or 64 or both I just need that tutorial man I appreciate that THANK YOU

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

      Hi, I have the 32 servo posted for my Patrons on Patreon.com . They have early access and it will come soon for everyone.

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

    Hello Robojax! Nice video as usual.
    I was wondering if you are ever going to do a video on NeoPixels or RGB LED strips (like the WS2812B)? I think it would be cool

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

      Thank you. I never heard of NeoPixels and just checked it. It looks cool. I will put it on my list. Perhaps to control the color using mobile phone.

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

    Hi, I have followed the video and it has helped perfectly! Thank you! A question I had was, when I hold down the button with this code, the servo starts to go crazy and go back and forth really fast. Is there a way to make it so no matter if the button is lightly pressed or held down that the servo rotates to the desired angle and stays before the next press? To give a bit of perspective, the button currently has to be tapped ever so slight and fast or the servo will go back and forth fast. Is there a way to prevent this? Thanks!!

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

      You are welcome. I have written a lot of codes and make videos, you may find one that works for your application. I have made them very customizable. So watch the video carefully and you will learn how to change the values th-cam.com/channels/kcBSig_Iu4ZnAIeCeG1TVg.htmlsearch?query=servo

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

    Good tutorial

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

      Thank you.

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

    Hi
    I have been learning the Arduino for use on model railway layouts ,not necessary for electronic projects in general .I have used your Sketch controlling a servo with pushbutton SBP2 Code #2.This works great ,but I wish to have six servo's each with it's own push button I have tried to expand the code to do this but have had problems . Your help will be most well received
    Regards
    Brian
    #

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

      Hi, you need to learn the meaning of Object. one example is here th-cam.com/video/5zT9iZRa5b4/w-d-xo.html and how to use multiple push buttons to control relay, but you learn the concept here th-cam.com/video/0PW22PD89u0/w-d-xo.html

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

      Hi .Thanks for your comments. I have watched your recommended tutorials and cannot find what I an doing incorrectly .Below is a copy of my sketch. Hope you are able to help me sort my problem. Having looked at your tutorials I believe I can reduce the the code but will do so when I get it to work.
      Regards
      Brian
      #include
      Servo myservo; // create servo object to control a servo
      Servo myservo1; // create servo object to control a servo
      Servo myservo2; // create servo object to control a servo
      Servo myservo3; // create servo object to control a servo
      Servo myservo4; // create servo object to control a servo
      Servo myservo5; // create servo object to control a servo
      #define servoPin 3 //~
      #define servoPin1 5 //~
      #define servoPin2 6 //~
      #define servoPin3 9 //~
      #define servoPin4 10 //~
      #define servoPin5 11 //~
      #define pushButtonPin 2
      #define pushButtonPin1 4
      #define pushButtonPin2 7
      #define pushButtonPin3 8
      #define pushButtonPin4 12
      #define pushButtonPin5 13
      int angle =90; // initial angle for servo
      int angleStep =30;
      const int minAngle = 70;
      const int maxAngle = 100;
      int buttonPushed =0;
      int angle1 =90; // initial angle for servo
      int angleStep1 =30;
      const int minAngle1 = 70;
      const int maxAngle1 = 100;
      int buttonPushed1 =0;

      int angle2 =90; // initial angle for servo
      int angleStep2 =30;
      const int minAngle2 = 70;
      const int maxAngle2 = 100;
      int buttonPushed2 =0;
      int angle3 =90; // initial angle for servo
      int angleStep3 =30;
      const int minAngle3 = 70;
      const int maxAngle3 = 100;
      int buttonPushed3 =0;
      int angle4 =90; // initial angle for servo
      int angleStep4 =30;
      const int minAngle4 = 70;
      const int maxAngle4 = 100;
      int buttonPushed4 =0;
      int angle5 =90; // initial angle for servo
      int angleStep5 =30;
      const int minAngle5 = 70;
      const int maxAngle5 = 100;
      int buttonPushed5 =0;
      void setup() {

      myservo.attach(servoPin); // attaches the servo on pin 3 to the servo object
      pinMode(pushButtonPin,INPUT_PULLUP);
      myservo1.attach(servoPin1); // attaches the servo on pin 5 to the servo object
      pinMode(pushButtonPin1,INPUT_PULLUP);
      myservo2.attach(servoPin2); // attaches the servo on pin 6 to the servo object
      pinMode(pushButtonPin2,INPUT_PULLUP);
      myservo3.attach(servoPin3); // attaches the servo on pin 9 to the servo object
      pinMode(pushButtonPin3,INPUT_PULLUP);
      myservo4.attach(servoPin4); // attaches the servo on pin 10 to the servo object
      pinMode(pushButtonPin4,INPUT_PULLUP);
      myservo5.attach(servoPin5); // attaches the servo on pin 13 to the servo object
      pinMode(pushButtonPin5,INPUT_PULLUP);
      }
      void loop() {

      if(digitalRead(pushButtonPin) == LOW){
      buttonPushed = 1;
      }
      if( buttonPushed ){
      // change the angle for next time through the loop:
      angle = angle + angleStep;
      // reverse the direction of the moving at the ends of the angle:
      if (angle = maxAngle) {
      angleStep = -angleStep;
      buttonPushed = 0;
      }
      myservo.write(angle); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle); // print the angle
      Serial.println(" degree");
      delay(100); // waits for the servo to get there
      }
      if(digitalRead(pushButtonPin1) == LOW){
      buttonPushed1 = 1;
      }
      if( buttonPushed1 ){
      // change the angle for next time through the loop:
      angle1 = angle1 + angleStep1;
      // reverse the direction of the moving at the ends of the angle:
      if (angle1 = maxAngle1) {
      angleStep1 = -angleStep1;
      buttonPushed = 0;
      }
      myservo1.write(angle1); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle1); // print the angle
      Serial.println(" degree");
      delay(100); // waits for the servo to get there
      }
      if(digitalRead(pushButtonPin2) == LOW){
      buttonPushed2 = 2;
      }
      if( buttonPushed2 ){
      // change the angle for next time through the loop:
      angle2 = angle2 + angleStep2;
      // reverse the direction of the moving at the ends of the angle:
      if (angle2 = maxAngle2) {
      angleStep2 = -angleStep2;
      buttonPushed = 0;
      }
      myservo2.write(angle2); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle2); // print the angle
      Serial.println(" degree");
      delay(100); // waits for the servo to get there
      }
      if(digitalRead(pushButtonPin3) == LOW){
      buttonPushed3 = 3;
      }
      if( buttonPushed3 ){
      // change the angle for next time through the loop:
      angle3 = angle3 + angleStep3;
      // reverse the direction of the moving at the ends of the angle:
      if (angle3 = maxAngle3) {
      angleStep3 = -angleStep3;
      buttonPushed = 0;
      }
      myservo3.write(angle3); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle3); // print the angle
      Serial.println(" degree");
      delay(100); // waits for the servo to get there
      }
      if(digitalRead(pushButtonPin4) == LOW){
      buttonPushed4 = 4;
      }
      if( buttonPushed4 ){
      // change the angle for next time through the loop:
      angle4 = angle4 + angleStep4;
      // reverse the direction of the moving at the ends of the angle:
      if (angle4 = maxAngle4) {
      angleStep4 = -angleStep4;
      buttonPushed = 0;
      }
      myservo4.write(angle4); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle4); // print the angle
      Serial.println(" degree");
      delay(100); // waits for the servo to get there
      }

      if(digitalRead(pushButtonPin5) == LOW){
      buttonPushed5 = 5;
      }
      if( buttonPushed5 ){
      // change the angle for next time through the loop:
      angle5 = angle5 + angleStep5;
      // reverse the direction of the moving at the ends of the angle:
      if (angle5 = maxAngle5) {
      angleStep5 = -angleStep5;
      buttonPushed = 0;
      }
      myservo5.write(angle5); // move the servo to desired angle
      Serial.print("Moved to: ");
      Serial.print(angle5); // print the angle
      Serial.println(" degree");
      delay(100); // waits for the servo to get there
      }

      }

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

    How to use a screen button In processing P3 ?
    Kind regards, I like you clear explanations and video’s

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

      sorry I didn't understand the "screen button" and "ps". With Regards.

  • @dyodjohar5328
    @dyodjohar5328 7 หลายเดือนก่อน

    Sorry sir, i want to ask you about my project. I have a project that using motobike and servo. They're totally working normal, servo and push button using your coding.
    But the problem is because the differences about acu voltage of bike is 12 volt and the servo 6volt i'm using step down dc to adjust both voltages, they only works when the bike's key contact standby On. But when the engine bike is running the movement of servo is uncontrol and the push button is not working.
    Should i use Relay to connecting the push button's wire to stabilize the bike acu's voltage which is 12v so the servo can works normally when engine motobike is running ? Thank you 🙏🏻

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

    thanks for your video , you have changed many value during you video , what will be the final coding for Moving Servo to ONE direction and stopped then press again to move to other direction

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

      You are welcome. Perhaps you missed what I said. Watch it again. I have over 10 videos on servo and don't know unless I watch it and then tell you. So you watch it. This is the most customization code that accommodates all needs. If you want my other videos on servo, here is the search link th-cam.com/channels/kcBSig_Iu4ZnAIeCeG1TVg.htmlsearch?query=servo

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

      @@robojax thanks for your fast reply , if I want the servo to move to the new location and stop even if I keep pressing the push boton , is it possible ? appreciate you support ,

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

      It means this project is only for ONE time. when, after the line where it sends signal to move the servo with all angles, just put while(1); and it will keep the program stopped.

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

    Hello Robojax!
    Very nice video, I do have a question. Can I also use this with a Continuous Rotation Servo? or would that be very different?
    Kind regards and Merry Christmas

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

      I believe I've replied to your other comment about so called "continuous servo". There is not such ting. it is fake. you need to get stepper motor.

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

      Alright, Thank you for the answer. I realized that I only needed a 180° servo, so I bought that instead.
      Have a nice day.

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

    Hi, I'm in need to do this with four servo motors for a school project. Is it the same process to get four servos hooked up? I would also like to have two travel CW and two travel CCW at the single push of a button. Would you be able to help or point me in the right direction? Thank you!!

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

      Using this video where I showed how to use multiple servos th-cam.com/video/KUqR3ZLX5Ks/w-d-xo.html you can use the SPB-2 video code to add your own 3 more push buttons. So you can combine both codes.

  • @erwingar11
    @erwingar11 4 ปีที่แล้ว +2

    Thank you so much for this video and the code. May I ask, according to code #2 if you push button once the servo will move from 0º to 180º and stop; and once you press the button again the servo will go back from 180º to 0º and stop, right?

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

      I don't know I have to watch the video and answer as since publishing the video I have written a lot of codes and made a lot of videos. So you watch it and find out.

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

    I want to use a linear actuator to open a door with single push button. If I push the button second time door should close and so on. I am using a homemade linear actuator with n20 geared motor with l298n n arduino uno. Please help....

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

      I have video on actuator here th-cam.com/video/EaoB6lfnS7g/w-d-xo.html but search my channel on more videos using push buttons Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo

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

    Hello, I'm from Indonesia, can you make a tutorial for servo control using a button with two presses and then it rotates

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

    My servo seems to be humming even while the button is not pressed. Do you know why? I thought it might be that it was going past the angle but i shorten the throw and it still does it. Great video for beginners like me! thank you

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

      You are welcome. Connect the power to servo, disconnect the signal pin. it should stop. if the humming did not stop, servo has issue. if stopped, your code has issue. you might have a value beyond the servo value. Check it.

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

    Nice Sir. Sir I wanted to ask you is it possible to control servo motors by pca9685 wirelessly by using an nrf24l01 module or a bluetooth module with arduino ?

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

      Wow. I would have to make a video. I will make it with ESP8266 and ESP32 so you can control is via mobile phone browser or computer browser.

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

    thanks for your fast reply , if I want the servo to move to the new location and stop even if I keep pressing the push button , is it possible ? appreciate you support ,

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

      so you want to it only for ONE time to pres and go? then what ? you wan to reboot the board or you want to have another reset button? if so I have reset button or "RETUR" push button that returns the servo back. Please use "replay" to all questions stay under the same first thread.

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

      I want it to go to the location in a push button , return back when pushed again , the only change i want is , single push or long push will do the same , just one movement

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

      this is the one. I believe this is the project for you. You press and it goes for example to 180° and stops. Then press it again and it returns back to 0° or whatever angle you set.
      If you want this: push and go to 180° and come back to 0° and stop, I have another project. The link is in the description.

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

      Dear Mr Ahmad , thanks for your fast reply , actually I have installed 12v to 5v dc convertor and regulator to power the Arduino from motorcycle , but still there is noise effecting the push button , do u think adding 470uf or 1000mf will help , (just to remind you that im having problem when attaching servo to Arduino on motorcycle that push button working without pressing the key while driving motorcycle , and no problem on parking )

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

      Nice ... thanks very much...I need for servo ac control application..nice to meet you. 👍👍

  • @Islam3Study3
    @Islam3Study3 7 วันที่ผ่านมา

    Hi, can I use this code in a science project? I saw on the notes it said I can only use it if that note is there. Can I just say who created the code and not the whole thing, please as it will take up space in my research report and abstract which has to be 200 words. Please reply soon I followed and hit the bell I really need you to respond as soon as possible

    • @robojax
      @robojax  7 วันที่ผ่านมา

      Hello, yes just mention and the website Robojax.com

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

    robojack: this is code is close to what I want, can you please put a dwell time loop, so at the second loop it can sit there before returning to 0 in seconds, Thank you

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

    I have an issue with my circuit, as it seems like the nano isnt registering the button. You said in video that one pin connects the button to arduino, to one of the non PWM pins, and the other to the ground pin on the arduino. However you mentioned to somebody else that the servos are also somehow connected to the button via 5V. How exactly should i connect the button to where the servos receive the signal ?

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

      The push button can be connected to any pin. Only servo needs PWM

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

      @@robojax i understand that but does the button need to be connected to the arduino via the 5V pin or the ground pin ?

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

      you made me watch the video. I have shown both wires in the video. I always anser if question is relevent or I have not explained it in the video. In this case it has been shown and I have shon it on a mini breadboard.

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

    is posible move 3 positions with only one push button? thank you

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

      Of course possible. I have explained it how it moves. If you want to move it instead one position to two or three, just repeat the moving action but perhaps you need to add delay between moves. So it moves to A then waits for some times the then to B and then wait and then C. Good luck

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

    hi, is it possible to make it keep moving after pressed the button once, then press once again to stop it?

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

      yes possible. Have a look at other servo video, I am sure you will find a solution th-cam.com/users/robojaxTVsearch?query=servo

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

    great Video ! but is there any way to make the servo faster? i tried to put the delay on (1) but its still so slow

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

      No. You have to pay for speed and they are 10 to 100x expensive and they very fast. Bing or google them.

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

      @@robojax but normally servo goes faster why it goes here slower than normal and please can you explain to me where should I put the resistor if I'm using one and how the push Button works only with ground and signal without connecting it to Postiv

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

      you might have something in the the loop. Also remove any Serial.print() if you have in the loop. that makes it very slow.

  • @danaranalengpe9079
    @danaranalengpe9079 3 หลายเดือนก่อน

    If I use 2 servo's, where I attach another yellow cable and power cable? And is the program different again?

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

      Hi, please search my channel I have so many video for servo with push buttons

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

    Tried that.There does not seem to be a contact link that I can find. Tried FB they listed a gmail address. I can pay via a PayPal donation. Basically I need to combine some of your posted codes......initial midpoint set, sweep, speed, remote button, detach, commands. I have the angles, in degrees and microseconds, and speed in delay microseconds. But it is beyond my scope to write all of this combined.

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

      Thanks. But.I am not doing any projects.

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

    my servo keeps spinning after going to 180, when I press the button it goes past 0 In the other direction can you please help me?

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

    I cannot find link to button from eBay or Amazon

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

      Hi, I just added the links.

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

    Hi
    how can i edit the code so that the servo goes from 0 to 180 and stops at 180 and not return

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

      Hi, I have so many examples. Search my channel for servo. Here is how you can search th-cam.com/video/OhkUceBWcHs/w-d-xo.html

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

    I have connected the adruino to the motorcycle and I supply it 7 volts with a dc-dc converter. every time I Marshall and the voltages go up instantly it resets. what could be wrong? What should I do?

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

      you can connect 12 to 15V at the input. you can use boost converter that gets 5 to 30V and give you any voltage you want. in this case set the output to 12V and if the input goes as low as 3V or 5V and up to 30V will keep the output 12V.

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

      @@robojax I power it with the 12 volt DC converter on the pin vin and it constantly opens and closes the servo. I supply 5 volts to the 5volts pin and it does the same, when I disconnect the servo, the led of the command continues and works. Once I disconnect it from the motorcycle circuit and power it with a 9 volts battery it works perfectly. I use arduino Nano

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

    Hi sir, does the same codes works for arduino NANO? Because the servo won't move with this specific code. The problem can either be the placement of connections of my arduino and servo, or there's need some changes to the codes or something? I have no knowledge whatsoever about coding stuff so it is very hard for me to solve this problem :(

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

      Yes it will work. the servo motor's middle wire is 5V make sure to connect to 5V and it will work.

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

      @@robojax yes the middle wire is connected to 5V, I've tried to use the Sweep example sketch to my servo and it works just fine, but in your code nothing happens to mine when I press the button :(

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

      here's the arrangement that I'm using: servo's brown wire - GND, red wire - button - 5V, and the orange wire - D9

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

      I've the changed the code to: myservo.attach(9); and i'm able to move the servo buuuut what happens is that the servo doesn't go back and forth, it stays to only one position, I have to rotate it manually, and I need to hold the button in order for the servo to move to this only certain angle. I really don't know what's happening here :( I just want to finished my motorized iron man helmet so bad :(

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

      I have tones of codes and videos on servo and each works differently so look here to find what you are looking for. the code is fine. it is how I've written it th-cam.com/users/RobojaxTVsearch?query=servo

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

    sir can you help me with the code for mlx90614 when the temparature is detected it would trigger led light and servo

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

      why you posted your question under wrong video? this about servo. th-cam.com/users/robojaxTVsearch?query=MLX90614 and I have explained how to "do something" when temperature reaches certain value. Post your question there and I will reply. This way others will learn as well.

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

    Does anyone know if it's possible to connect two servos to one button?? I searched everywhere! Not finding anything😔

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

      see my other reply.

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

    help please for some reason the servo just keeps moving back and forth on its own without me pressing the button.

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

      First tey the code without changing. if you have not changed it then wiring is conncorret with push buttons. check them again.

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

      @@robojax thank you i was able to fix it

  • @R.S.CINEMATIC
    @R.S.CINEMATIC 3 ปีที่แล้ว

    how I control each servo motor with saperate switch after programing please help me sir

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

      Here is my video on more than ONE servo th-cam.com/video/_uz7YcOzvjU/w-d-xo.html. for push button and variables that is controlling the servo, you have to replicate them for 2nd and 3rd servo motor. If you pay attention to both video's code section, you would easily be able to do it.

    • @R.S.CINEMATIC
      @R.S.CINEMATIC 3 ปีที่แล้ว

      Can you provide me your email address

    • @R.S.CINEMATIC
      @R.S.CINEMATIC 3 ปีที่แล้ว

      That i can easily talk with you

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

      sorry, other than replying to comments, I have no time.

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

    How can I control 2 servos?

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

      The same way we defined input pin for push switch and servo, define more for 2nd servo and define all the variables that we used for the 1st servo , do define them for 2nd servo. Watch the code section of this video 2, 3 or 4 times to learn it. or watch this 30 minuets Arduino course th-cam.com/video/Mbb2xa1WcRM/w-d-xo.html or start the full Arduino course with over 100 lessons here robojax.com/L/?id=135

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

      @@robojax thank you. I'll try

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

    does anyone know how to do this on raspberry pi 3?

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

      some one who knows reply please. I haven't done this.