Been looking for this code demo for a long time... Well done thank you!
@robojax
4 жыл бұрын
You are welcome.
@insmrskarllate952
4 жыл бұрын
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
4 жыл бұрын
32 or 64 or both I just need that tutorial man I appreciate that THANK YOU
@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.
@user-ob5en9br1z
Жыл бұрын
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.
@donaldhenke2750
3 жыл бұрын
thanks for your vids. GREAT.
@robojax
3 жыл бұрын
My pleasure!
@ZasaSaza34
4 жыл бұрын
Good tutorial
@robojax
4 жыл бұрын
Thank you.
@briandavis9489
2 жыл бұрын
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
2 жыл бұрын
Hi, you need to learn the meaning of Object. one example is here kzitem.info/news/bejne/lrCKn52Qi5NmlWk and how to use multiple push buttons to control relay, but you learn the concept here kzitem.info/news/bejne/kYaNmGaGfWpqqGU
@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 } }
@YouAreWatching23
2 жыл бұрын
Thank YOu Bro. Love it.
@ElectricalSolution
4 жыл бұрын
Nice and very useful tutorial. thanks to you
@robojax
4 жыл бұрын
You are welcome.
@cobalt01snet
4 ай бұрын
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
@dyodjohar5328
11 ай бұрын
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 🙏🏻
@erwingar11
4 жыл бұрын
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
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.
@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
4 жыл бұрын
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.
@NSanCHANEL
2 жыл бұрын
Hello, I'm from Indonesia, can you make a tutorial for servo control using a button with two presses and then it rotates
@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
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 kzitem.info/rock/kcBSig_Iu4ZnAIeCeG1TVgsearch?query=servo
@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
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.
@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
2 жыл бұрын
I have video on actuator here kzitem.info/news/bejne/ppelqGqin6CEapw but search my channel on more videos using push buttons Here is how to find Specific KZitem Video in a channel bit.ly/findKZitemVideo
@Islam3Study3
3 ай бұрын
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
3 ай бұрын
Hello, yes just mention and the website Robojax.com
@Islam3Study3
2 ай бұрын
@@robojax Thank you so much!!!
@degrootadrianus
4 жыл бұрын
How to use a screen button In processing P3 ? Kind regards, I like you clear explanations and video’s
@robojax
4 жыл бұрын
sorry I didn't understand the "screen button" and "ps". With Regards.
@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
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 kzitem.info/rock/kcBSig_Iu4ZnAIeCeG1TVgsearch?query=servo
@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
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.
@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
Жыл бұрын
The push button can be connected to any pin. Only servo needs PWM
@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
Жыл бұрын
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.
@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?
@danaranalengpe9079
7 ай бұрын
If I use 2 servo's, where I attach another yellow cable and power cable? And is the program different again?
@robojax
7 ай бұрын
Hi, please search my channel I have so many video for servo with push buttons
@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
4 жыл бұрын
Using this video where I showed how to use multiple servos kzitem.info/news/bejne/rIunuGeQhYpmfqg you can use the SPB-2 video code to add your own 3 more push buttons. So you can combine both codes.
@jordanbosco
2 жыл бұрын
is posible move 3 positions with only one push button? thank you
@robojax
2 жыл бұрын
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
4 жыл бұрын
hi, is it possible to make it keep moving after pressed the button once, then press once again to stop it?
@robojax
4 жыл бұрын
yes possible. Have a look at other servo video, I am sure you will find a solution kzitem.infosearch?query=servo
@sablemotion9289
4 жыл бұрын
help please for some reason the servo just keeps moving back and forth on its own without me pressing the button.
@robojax
4 жыл бұрын
First tey the code without changing. if you have not changed it then wiring is conncorret with push buttons. check them again.
@sablemotion9289
4 жыл бұрын
@@robojax thank you i was able to fix it
@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
3 жыл бұрын
Thanks. But.I am not doing any projects.
@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
4 жыл бұрын
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
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
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
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
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
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
3 жыл бұрын
Nice ... thanks very much...I need for servo ac control application..nice to meet you. 👍👍
@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
2 жыл бұрын
Hi, I have so many examples. Search my channel for servo. Here is how you can search kzitem.info/news/bejne/sJ6hu5ebe4mUe6g
@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
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
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.
@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
2 жыл бұрын
No. You have to pay for speed and they are 10 to 100x expensive and they very fast. Bing or google them.
@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
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.
@richardstiers9010
3 жыл бұрын
I cannot find link to button from eBay or Amazon
@robojax
3 жыл бұрын
Hi, I just added the links.
@kiparissas
4 жыл бұрын
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
4 жыл бұрын
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
4 жыл бұрын
@@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
@egyptstarrk3728
4 жыл бұрын
Does anyone know if it's possible to connect two servos to one button?? I searched everywhere! Not finding anything😔
@robojax
4 жыл бұрын
see my other reply.
@eduardoalajas8153
4 жыл бұрын
sir can you help me with the code for mlx90614 when the temparature is detected it would trigger led light and servo
@robojax
4 жыл бұрын
why you posted your question under wrong video? this about servo. kzitem.infosearch?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.
@Islam3Study3
Ай бұрын
Hi robojax I need help right away!! i subbed and liked, so how do I make this code go smoothly from 1 to 179? #include Servo servo1; // create servo object to control servo 1 Servo servo2; // create servo object to control servo 2 Servo servo3; Servo servo4; Servo servo5; #define servoPin1 3 // pin for servo 1 #define servoPin2 5 // pin for servo 2 #define servoPin3 6 #define servoPin4 9 #define servoPin5 10 #define pushButtonPin 2 // push button pin int angle1 = 10; // initial angle for servo 1 int angle2 = 10; // initial angle for servo 2 int angle3 = 10; int angle4 = 10; int angle5 = 10; int angleStep1 = 50; // amount by which to move servo 1 each time int angleStep2 = 50; // amount by which to move servo 2 each time int angleStep3 = 50; int angleStep4 = 50; int angleStep5 = 50; const int minAngle1 = 1; // minimum angle limit for servo 1 const int maxAngle1 = 179; // maximum angle limit for servo 1 const int minAngle2 = 1; // minimum angle limit for servo 2 const int maxAngle2 = 179; // maximum angle limit for servo 2 const int minAngle3 = 1; const int maxAngle3 = 179; const int minAngle4 = 1; const int maxAngle4 = 179; const int minAngle5 = 1; const int maxAngle5 = 179; int buttonPushed = 0; // flag to track button press void setup() { Serial.begin(9600); // initialize serial communication servo1.attach(servoPin1); // attach servo 1 to pin 3 servo2.attach(servoPin2); // attach servo 2 to pin 5 servo3.attach(servoPin3); servo4.attach(servoPin4); servo5.attach(servoPin5); pinMode(pushButtonPin, INPUT_PULLUP); // set push button pin as input with internal pull-up resistor Serial.println("Multiple Servo Button Control"); // print message to Serial Monitor } void loop() { // Check if button is pressed if (digitalRead(pushButtonPin) == LOW) { // Toggle button state buttonPushed = 1; delay(50); // debounce delay } // Control servo 1 if button is pressed if (buttonPushed) { // Increment angle for servo 1 angle1 += angleStep1; // Reverse direction if angle1 reaches limits if (angle1 = maxAngle1) { angleStep1 = -angleStep1; buttonPushed = 0; // reset buttonPushed flag } servo1.write(angle1); // move servo 1 to desired angle Serial.print("Servo 1 moved to: "); Serial.println(angle1); // print angle1 to Serial Monitor delay(100); // wait for servo to reach position } // Control servo 2 if button is pressed if (buttonPushed) { // Increment angle for servo 2 angle2 += angleStep2; // Reverse direction if angle2 reaches limits if (angle2 = maxAngle2) { angleStep2 = -angleStep2; buttonPushed = 0; // reset buttonPushed flag } servo2.write(angle2); // move servo 2 to desired angle Serial.print("Servo 2 moved to: "); Serial.println(angle2); // print angle2 to Serial Monitor delay(100); // wait for servo to reach position } // Control servo 2 if button is pressed if (buttonPushed) { // Increment angle for servo 2 angle3 += angleStep3; // Reverse direction if angle2 reaches limits if (angle3 = maxAngle3) { angleStep3 = -angleStep3; buttonPushed = 0; // reset buttonPushed flag } servo3.write(angle3); // move servo 2 to desired angle Serial.print("Servo 3 moved to: "); Serial.println(angle3); // print angle2 to Serial Monitor delay(100); // wait for servo to reach position } // Control servo 4 if button is pressed if (buttonPushed) { // Increment angle for servo 2 angle4 += angleStep4; // Reverse direction if angle2 reaches limits if (angle4 = maxAngle4) { angleStep4 = -angleStep4; buttonPushed = 0; // reset buttonPushed flag } servo4.write(angle4); // move servo 2 to desired angle Serial.print("Servo 4 moved to: "); Serial.println(angle4); // print angle2 to Serial Monitor delay(100); // wait for servo to reach position } // Control servo 2 if button is pressed if (buttonPushed) { // Increment angle for servo 2 angle5 += angleStep5; // Reverse direction if angle2 reaches limits if (angle5 = maxAngle5) { angleStep5 = -angleStep5; buttonPushed = 0; // reset buttonPushed flag } servo5.write(angle5); // move servo 2 to desired angle Serial.print("Servo 5 moved to: "); Serial.println(angle5); // print angle2 to Serial Monitor delay(100); // wait for servo to reach position } }
@robojax
Ай бұрын
Hi, what do you mean by "smoothly". the smallest value to increment the angle is 1 degree. Simply increase the delay. if you reduce the delay, it will wait and then move to the next value. if you increase it, it will go faster but play with the number so it goes to your desired speed.
@Islam3Study3
Ай бұрын
@@robojax thank you so much, what i mean by smoothly is that with this code it stops then moves stop then moves so i want it to move from 1 to 179 degrees without stopping. Thank you so much once agaiN!
@robojax
Ай бұрын
Then my answer above is the solution
@Islam3Study3
Ай бұрын
@@robojax THANK YOU SO MUCH IT NOW WORKSS!!! YOUR A LIFE SAVER
@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
3 жыл бұрын
Yes it will work. the servo motor's middle wire is 5V make sure to connect to 5V and it will work.
@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
3 жыл бұрын
here's the arrangement that I'm using: servo's brown wire - GND, red wire - button - 5V, and the orange wire - D9
@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
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 kzitem.infosearch?query=servo
@R.S.CINEMATIC
4 жыл бұрын
how I control each servo motor with saperate switch after programing please help me sir
@robojax
4 жыл бұрын
Here is my video on more than ONE servo kzitem.info/news/bejne/wKuwnY2ZiKynnYo. 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
4 жыл бұрын
Can you provide me your email address
@R.S.CINEMATIC
4 жыл бұрын
That i can easily talk with you
@robojax
4 жыл бұрын
sorry, other than replying to comments, I have no time.
@speedyweedygamerz1353
4 жыл бұрын
does anyone know how to do this on raspberry pi 3?
@robojax
4 жыл бұрын
some one who knows reply please. I haven't done this.
@danielezambelli9745
2 жыл бұрын
How can I control 2 servos?
@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 kzitem.info/news/bejne/rpiYmKyXaomUhYI or start the full Arduino course with over 100 lessons here robojax.com/L/?id=135
@danielezambelli9745
2 жыл бұрын
@@robojax thank you. I'll try
@milk-boy
Ай бұрын
i see your still making youtube videos so i thought i might have a shot getting some help on this could you possibly do a video on this and show how to make it so it rotates 180° every time it’s powered?
@robojax
Ай бұрын
The main arduino code that comes with the servo is the one that goes from zero to 180 and comes back. You know how to send a servo to any angle. If not watch introduction video. The code that is inside the loop() put it inside setup() and it will run only once. And does not come back.This is so simple, you can’t ask any further questions if you watch introduction to servo. Just search servo and you see introduction to servo on my channel. Good luck
@milk-boy
Күн бұрын
@@robojax got that working and then it said usb no longer recognize device after plugging it into a battery that was within wattage/voltage of the recommended specs, has that ever happened to you, i updated and reinstalled all drivers and softwares i even got a new cable is the arduino just fried ?
Пікірлер: 110