No video

Arduino Tutorial 33: Understanding How to Control Servos with a Joystick

  Рет қаралды 128,670

Paul McWhorter

Paul McWhorter

Күн бұрын

You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
/ paulmcwhorter
In this project we will control the position of two servos using a joystick. The project also incorporates a buzzer which is activated if the joystick knob is pressed down. We show the math that allows smooth and easy control of the servos.
You can get the kit I am using for this series at the following link:
amzn.to/2I7N4Ek
Also, you can get nicer servos than the ones in the Elegoo kit here. These are the good ones I use in most of my projects, and will .
amzn.to/2Ix8ATa
OK, also you can follow these lessons on our WEB site. Here is this lesson:
toptechboy.com...
[Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. This means if you visit the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.]
#Arduino

Пікірлер: 2 100
@atayl0r1
@atayl0r1 9 ай бұрын
Most Arduino forums/social media are recommending Paul McWhorter when beginners ask where they should start. Well done Paul! BOSCO!
@eyoscarygc2019
@eyoscarygc2019 3 жыл бұрын
i am following your lesson without elegoo because of my parents can't afford it but i'am studying hard enough to be amazing programmer thank you paul you are helping me so much
@robertmckelvey3091
@robertmckelvey3091 3 ай бұрын
Did you ever end up getting you a Arduino set to play around with
@jacobbedard9350
@jacobbedard9350 Жыл бұрын
In case you don't hear it often enough, you're awesome at this. Thanks for these videos!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Glad you enjoy it!
@fungaifakazi
@fungaifakazi 12 сағат бұрын
i hope Basco is still around and alive by this time , Long live Paul McWhorter!
@Bob-zg2zf
@Bob-zg2zf 4 жыл бұрын
KZbin is home to various outstanding IT vloggers. I've watched, subscribed and unsubscribed many. Paul remains the top one I need to constantly follow. Not because of his skills, but for his past achievement and mentality. Thank you for making me smarter.
@olegvelichko1659
@olegvelichko1659 4 жыл бұрын
Bob I second that motion.
@chadestell745
@chadestell745 4 жыл бұрын
He is a great teacher of the very cool Arduino system!!!!
@tj9382
@tj9382 3 жыл бұрын
Totally agree.
@waelal-halawani8056
@waelal-halawani8056 3 жыл бұрын
what past achievements do you mean?
@TheUnofficialMaker
@TheUnofficialMaker 2 жыл бұрын
@@waelal-halawani8056 Watch his other videos and you will discover!
@tomreese9127
@tomreese9127 4 жыл бұрын
I flew RC planes in the 80s,found 3 servos in the basement and they still work. Hope Bosco is safe from Corona.
@gawielagrange4786
@gawielagrange4786 Ай бұрын
Hi Paul. I built the setup with two servos in a pan-tilt kit I bought from our local botshop. I used a laser transmitter module (KY-008) on the top of my pan-tilt kit and connected it to the pin that was originally connected to the buzzer. I was able to shine my laser all over the ceiling by controlling it all with the joystick. Great fun! Thanks for a great course!
@SteakBackD
@SteakBackD 2 жыл бұрын
Bosco! Thank you so much for all the amazing tutorials. Having so much fun with all the small projects. P.S as a mechanical engineering student, these projects are even more relevant! :)
@khushidhingra6524
@khushidhingra6524 3 жыл бұрын
"BOSCO" I think that Paul is highly mistaken we love math And if you are reading this, please don't end this series It's a humble request
@kenspyder1394
@kenspyder1394 4 жыл бұрын
Hey Paul. Great tutorials. I'm a newbie to the Arduino world, and although I'm 65 I feel like I'm back in school again. Thoroughly enjoying your animated videos. Say hi to Bosco for me!
@daveflatters4981
@daveflatters4981 3 жыл бұрын
I’m also 65. I used to work in IT and I’ve dabbled with Arduino and Python in the past. These lessons and Paul’s Python course are very good.
@waynedoman4165
@waynedoman4165 Күн бұрын
Bosco! Paul, your lessons bring just the right amount of challenge and humour that keeps you wanting more. Ps. Keep the maths coming, it is really good to get a full understanding 🙂
@josephdscordio2862
@josephdscordio2862 2 жыл бұрын
Thanks Paul , it worked for me without that math equation and i used just one servo cause i don't have two or extra and also i did it without the buzzer but i compensate it , with a Happy blue LED only for a special occasions as this, here's my code below : #include Servo myservo; int Vrx=A0; int Vry=A1; int Xval; int Yval; int Switch=8; int Sval; int analogvalue; int servo=6; int dt=300; int LedB=2; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(Vrx,INPUT); pinMode(Vry,INPUT); pinMode(LedB,OUTPUT); digitalWrite(Switch,HIGH); pinMode(Switch,OUTPUT); myservo.attach(servo); } void loop() { // put your main code here, to run repeatedly: analogvalue=analogRead(Vrx); analogvalue=map(analogvalue,0,1023,0,180); myservo.write(analogvalue); delay(dt); //Serial.println(analogvalue); Xval=analogRead(Vrx); Yval=analogRead(Vry); Sval=digitalRead(Switch); Serial.print("Value X= "); Serial.print(Xval); Serial.print(" Value Y= "); Serial.print(Yval); Serial.print(" Value Switch= "); Serial.println(Sval); if (Sval==0){ digitalWrite(LedB,HIGH); } else { digitalWrite(LedB,LOW); } }
@DanTran-if2jt
@DanTran-if2jt 4 жыл бұрын
Bosco! "because we do math" lol :)) This episode is so much fun.
@paulsmigel857
@paulsmigel857 4 жыл бұрын
Bosco. I am watching every episode from 1-33 so far. And will continue to the end. It’s not easy, especially the math, but I am getting it done and I don’t go further until I am successful. Really learning a lot by trial and error. But I just love the challenge. 👍👍👍
@drbirdleaf2574
@drbirdleaf2574 11 ай бұрын
Tell Bosco to keep doing good work protecting one of KZbins greatest gifts. It’s kind of fun to watch how there’re fewer comments on each video the further along we get. It gets me thinking about how things come up in life and some things get put aside, sometimes to be returned to and sometimes forgotten about. I myself have things coming up that I’m going to have to take a break for a couple weeks to complete some obligations and hopefully return. But I have a couple days until then so I’ll try to get one more lesson in.
@thefierceninja2557
@thefierceninja2557 2 жыл бұрын
First things first, Bosco! Second things second, I put off the lessons that come after this so I could get the HiTech servos that you suggested and it was worth the wait and now I have my first robot arm sitting right in front of me as I'm typing. This is an amazing achievement for me because I now have obtained most of the basic knowledge and skills one would need to re-create the funniest machine in Tony Stark's workshop, Dummy. In all seriousness, this is cool, definitely have to build the full scale one at some time in my life. Thanks for continuing to be a great teacher Paul!
@sravanimalekar643
@sravanimalekar643 4 жыл бұрын
BOSCOO!! You make learning so much fun. I'm a 2nd year engineering student and I hope i become one like you. You are great Paul.
@muhammadrafiqulislamkhan6994
@muhammadrafiqulislamkhan6994 2 жыл бұрын
You are so much lucky student who gets Paul so early. After finishing my Computer diploma engineering I finally find my Coder God Paul almost 18 years. Those students are lucky who find Paul as a code teacher. Such a great teacher to me. Thank you.
@MrJohnjamesboyd
@MrJohnjamesboyd 4 жыл бұрын
“Bosco”, your videos are awesome thank you so much for making them. I am also an engineer but a civil one, so maths not an issue but love the extra detail on electronics. 33 videos watched in two days I’m addicted I can’t stop, lol
@grahamovermyer5987
@grahamovermyer5987 Жыл бұрын
Bosco! I did this on my own before watching the video! I am excited that I'm starting to pick up on the intuitive process of circuit building and programming once I learned the basics. But I always watch your videos after I attempt to see if you do it differently and or give any tips or advice during the session.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Great job!
@Fractal_CZ
@Fractal_CZ 2 жыл бұрын
Paul reminds me my grand dad 30 years ago. He was so passionate about electronics. He even bought the same Atari800 and we talked to each other (i was 15 then) about Atari basic contraptions. This fact (and many others) keep me returning here. Thumbs up!
@ericsmith7988
@ericsmith7988 4 жыл бұрын
Pooky is actually called "Putty tape" it is used for sealing windows, vents and other objects that need sealed, commonly used on RV's. Thank Paul ,I am watching all these lessons again. I am learning more because I went a bit too fast the first time, didn't pay good enough attention.
@yargew
@yargew 3 жыл бұрын
Eric, Much thanks! I am having to skip around in the tutorials due to a deadline for a project. I ran across Paul referring to Pooky in a much later lesson and have been going nuts trying to find it. I have been skipping forward in the lessons to see where he first used it to try to find out where to get it. Your tip is what did the trick. Thanks againi@
@ErlankBru
@ErlankBru 3 ай бұрын
In South Africa they sell it as Prestik.🤓
@stephanvb5561
@stephanvb5561 3 жыл бұрын
This project was so much fun. Keep that great work coming Paul. Cant wait for all the new things to learn with you. Bosco!
@alanfowler3069
@alanfowler3069 3 жыл бұрын
Bosco, Really enjoying these tutorials. Thanks, I'm hooked.
@nguyentranvantien8028
@nguyentranvantien8028 Жыл бұрын
Bosco. I did it my self before watching your instruction but i still made it to the end of this amazing, fascinating and engaging lesson.
@krithikavenkatesan2123
@krithikavenkatesan2123 3 жыл бұрын
"Battle of the Servos" lol. I love your videos Paul! and... Bosco!
@mikemoragne
@mikemoragne 3 жыл бұрын
Slowly making my way through your tutorials! I know the math isn’t the fun part but I really appreciate you explaining why and how things work. It really helps I’m already dreaming up ideas of things I want to make! I can’t wait to watch the rest!!! Thank you sooooo much for making these! :)
@fablapp
@fablapp 2 жыл бұрын
2 years after the last commets I am still enjoying these tutorials, and send my greetings to Bosco (hope it is the correct spell)!
@davidbuckley4912
@davidbuckley4912 Жыл бұрын
I certainly did get to the end. Really enjoying the videos. I hope Bosco is not too busy in his official capacity
@andywylie287
@andywylie287 3 жыл бұрын
Bosco! Another thoroughly enjoyable, educational, life improving tutorial from one of the best teachers out there. Thanks Paul. God bless!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
My pleasure!
@chukwusmart9918
@chukwusmart9918 4 жыл бұрын
Bosco! Made it to the end. Amazing tutorials, really amazing.✌
@TheBrockbencomo
@TheBrockbencomo 3 жыл бұрын
I just getting ready to watch the stepper motor tutorial. Im watching them all through to the end then starting from beginining doing the electronics part.
@josegayoso2452
@josegayoso2452 Жыл бұрын
Thanks Paul for teaching us how to use the Arduino. We see the entire video as the prove, it was nice to meet Bosco.
@DHRUVGUPTA-ui6sf
@DHRUVGUPTA-ui6sf Жыл бұрын
Bosco!!!! Feeling amazed by seeing glimpse of the power of Arduino!!! 🤩🤩
@Anonymous-yy5qr
@Anonymous-yy5qr 3 жыл бұрын
Guis just remember one thing in life... Never mess with "Bosco", he has this "Laser of Death" made from Arduino by which he beats the shit out of the intruders :)
@waynenicolson5864
@waynenicolson5864 3 жыл бұрын
Hi Paul, I was lucky to have spent some time in Bosco's country on and off during 2004 & 2005. I was working between there and the country to the west of there. Having worked in a number of other countries since then I always remember how friendly the people were even though most of them don't have much. I was also fortunate enough to get to do the River Rafting trip on that awesome river that we sometimes see in your background pictures. What an awesome place to stay! Keep safe there in these times! And thanks for the entertaining lesson on the joystick and the Servos! Regards Wayne!
@michaeljenkins2345
@michaeljenkins2345 3 жыл бұрын
Mr McWhorter, I recently got a Raspberry Pico and can definitely say, its a bleak learning landscape without your tutorials! :)
@jasonrhoades4122
@jasonrhoades4122 2 жыл бұрын
BOSCO!!! I've always wanted to visit Africa. I've heard there are some beautiful places to see. Love this lesson, pan/tilt can be a very useful design. You're givin me even more ideas!!! I'm about to get a 3d printer (still deciding on the right one) and then the sky's the limit! By the time I get through all these lessons, I hope to be able to build and program a whole new world!! If I can dream it, I can build it! Thats the goal!
@ErlankBru
@ErlankBru 3 ай бұрын
Thanks Paul for this most awesome series of tutorials and thanks to Bosco for keeping you and everyone else safe so you could record in your studio with peace of mind🙏. I did some major exam-like revision all the way up to tutorial 30, not exactly done yet, but my curiosity wanted to continue with these MOST excellent tutorials while I'm in the process of reviewing. I've never done programming before, which is why I want to keep going back so I can gain long term memory knowledge.😶‍🌫📚💡
@user-qs4ti1bh6e
@user-qs4ti1bh6e Ай бұрын
From a learning standpoint, the components in the kit are excellent. Easy to use and work with on a desk/tabletop top workspace and they make it easy to scale up to larger/more sophisticated projects later on. I'm sure that's how the kit was engineered and they hit a home run IMHO.
@anilcank
@anilcank 2 жыл бұрын
Buscov looks like a very polite man, thank you for the tutorial Paul really appreciate it :)
@jonathanmalamy3760
@jonathanmalamy3760 Жыл бұрын
Paul, we are all here at the end. Bosco sets our minds at ease.
@ennisyui
@ennisyui 2 жыл бұрын
Bosco! I'm very glad that I did it without watching or copying the contents in the lesson. Thank you so much Paul!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Glad it was helpful!
@hunterpalmer9706
@hunterpalmer9706 3 жыл бұрын
Dear Bosco, thank you for protecting my engineering Sensei, I bow to you! From, Hunter.
@donvanote
@donvanote 11 ай бұрын
IIt took several days as I had to order the servos, and then life etc. But I really enjoyed this lesson and making the servos respond to the joystick. Thank you!
@muhammadrafiqulislamkhan6994
@muhammadrafiqulislamkhan6994 2 жыл бұрын
I watch your video over and over again. And I would say, you are very special teacher to me. If I become an Arduino programmer, all credit goes you because you the teacher where I learn first this miracle programming. Thanks.
@toolooselowtrek7523
@toolooselowtrek7523 Жыл бұрын
I am going to tell my grandchildren about you, Paul. You motivate mathematics like Descartes.
@Rorschachcollision
@Rorschachcollision 9 ай бұрын
I love how watching the previous lessons really starts to pay off in these lessons. Very easy and logical if you follow along.
@johnvandenberg2445
@johnvandenberg2445 Жыл бұрын
Bosco . Thanks Paul as an Australian Retired Electronics Engineer it is easy but fun and that is the main thing. Really appreciate it.
@toolooselowtrek7523
@toolooselowtrek7523 Жыл бұрын
Thanks for those side comments, such as “”Don’t treat servos like fidgets”. So helpful!!!
@richthofen9592
@richthofen9592 4 ай бұрын
You make me be proud for being one of those who understand how to program a joystick with servomotors, also for knowing what BOSCO means and why we are commenting BOSCO!!!!!!!!!
@hughpatterson1480
@hughpatterson1480 2 жыл бұрын
Great video! This one is perfect for students exploring the idea of being able to make robotic devices. I tell my students that they are lucky to have gotten into electronics today, when you have devices such as the Arduino available to them. At sixty years old, I tell them that all we had to work with back in the day were vacuum tubes and breadboards made from our mother's cutting boards and our fathers roofing nails. Of course, they all look shocked when I tell them there was once a world without the internet....
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Yes, I am also 60 and in High School I went through physics using a slide rule. People today have trouble believing you can do math using a couple of special rulers latched together.
@gilnasty82
@gilnasty82 2 жыл бұрын
Yes, it is hard for them to imagine a world without the World Wide Web!!! I bet most don't even know what that stood for, or remember dial up internet!!
@calvindeiterich9913
@calvindeiterich9913 Жыл бұрын
Bosch - made it through to the end.
@powersprouter
@powersprouter 2 жыл бұрын
Hello Bosco! It's so funny, TopTechBoy reruns are even more fun than watching old star trek episodes all over again. Binge-ing to the end by tomorrow night. 😋
@dhobonov
@dhobonov 2 жыл бұрын
When i was a kid, BOSCO was an amazing syrup that mixed with milk to make chocolate milk. It was great but not as great as these tutorials. Thank you, Paul. It's Christmas here right now so Merry Christmas to you and your family.
@emoraven88
@emoraven88 2 жыл бұрын
Hi Paul. I couldn`t follow along with you on this video because I only have the Elegoo servo motor. But to compensate for that I did a self-assignment to control a servo motor, the brightness of 4 LEDs and the state of a 5th LED, using the joystick. I allowed myself to use different colours of the LEDs as this was a special occasion to me. I made the 4 LEDs to increase their brightness one after another with overlapping when I move the joystick from right to left and to decrease their brightness one after another with overlapping when I move the joystick from the left to the right. I made the servo pointer to point up or down, corresponding with the direction of the joystick and I made the 5th LED (red) to come ON every time I press the joystick in.
@unknownswords4872
@unknownswords4872 Жыл бұрын
sir you explained it really nice . this is the first vedio where i had seen someone programming live and explaining calculations bheind the process . i had found your videos for arduino. thanks a lot sir. plz make such intersting and indepth tutorial for students who will to make many good project but lag due to lack of programming and proper guidence. !!!!
@kirillsanchez5110
@kirillsanchez5110 4 күн бұрын
Bosco! Thank you for teaching us joysticks and servos for Arduino!
@GMPmovies
@GMPmovies 2 жыл бұрын
Bosco. It's 2022, and I'm just finding these videos. I've watched all of them up to this point so far and they are incredible. Thank you so much for sharing your knowledge!
@shatterism3329
@shatterism3329 Жыл бұрын
Bosco! I can't believe I made it this far, it's only possible because of a great teacher. Thank you Paul for teaching me the way my past teachers cannot. A month away before my first year of being a Computer Engineering student!
@jackeetyler
@jackeetyler 2 жыл бұрын
Bosco in 2021, and continue watching... just wish I had teachers like you!
@terryhoward986
@terryhoward986 3 жыл бұрын
Hi Paul, Bosco is the word, glad to hear you like Africa we cant wait to get back there again. Thanks for the knowledge sharing.
@frang342
@frang342 10 ай бұрын
Bosco is the answer,I watch all the tutorials till the end. I know math is not the most interesting however I copy all the math equations to a spiral notebook that I have for all my electronics for Arduino. I keep it for reference I could never remember all the little things I learn. I'm new to electronics, as a hobby. I'm 65 years old and I'm getting a lot from your tutorials they are helping me out with the coding part to go with the electronic circuits. Thanks
@larryshreve9076
@larryshreve9076 Жыл бұрын
"Bosco" I've been watching every second of each video and enjoying it immensely (even 2 years later)
@RobVollmar
@RobVollmar Жыл бұрын
Bosco! It took me a week to secure the components and figure out how to mount one servo to another without the putty tape but I got here.
@richardbritain7435
@richardbritain7435 2 жыл бұрын
Bosco. This was brilliant. After struggling with a few additional bits of my ,own this lesson also reminded me of the '==' command. Thanks for the great lesson.
@fridaycpc5210
@fridaycpc5210 9 ай бұрын
BOSCO I really enjoy all your teachings. I believe that one day I will be a guru like you. Please keep it up, I love it.
@santiagoperaza967
@santiagoperaza967 Жыл бұрын
I was able to do it without watching this video .... I could control the servo with the joystick .... so refreshing to see is similar to what you did Mrs. Paul .
@santiagoperaza967
@santiagoperaza967 Жыл бұрын
bosco
@erikburman530
@erikburman530 Жыл бұрын
I think that by now you know that there are those of us who pay close attention to the very end. So....BOSKO! And yeah that guy looks like he will put up with no nonsense. I suspect that the same applies to your Texas prepper homestead. I'm loving your Arduino tutorials. I'm beginning to feel like I might become a coder!
@RavensHammer00
@RavensHammer00 Жыл бұрын
Bosco! Kinda got behind my schedule, had to wait for a pair of servos to arrive in the mail...I got to find a better way to get stuff in the mail, because watching an item sitting in a shipping hub for a couple of days made me want to pull what's left of my hair out! Love your content and your style of teaching, Paul. God bless you for sharing your knowledge with us!
@akbarkhalaji9196
@akbarkhalaji9196 2 жыл бұрын
Bosco life is beautiful when there is people like you
@thomasmaxwell4396
@thomasmaxwell4396 Жыл бұрын
Hi Paul - It's me again! Bosco still rocks! It WAS a lot to cover - although, you've already covered all the subjects in earlier lessons. It is great to put everything together into one refresher! And GOD BLESS THE QUEEN!
@souvikmandal1919
@souvikmandal1919 3 жыл бұрын
"You don't wanna mess with BOSCO" Enjoying each and every video of this series. I hope to learn new things and be able to convey them like you do. Much Love.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
You can do it!
@johnkaradimas8403
@johnkaradimas8403 Жыл бұрын
Hi Paul Yes I watched your lesson 33 to the end, Where you explained the different temperatures and about Bosco. Thankyou
@yamaha893
@yamaha893 11 ай бұрын
bosco may be tough, but hes gonna need a bigger coat if he ever comes to alberta in the winter! great episode, thanks again as always to Mr. McWhorter and to Bosco!
@bleujaegel
@bleujaegel Жыл бұрын
Bosco. These tutorials are a blast! I have learned so much. Funny thing is that my son was calculating slopes in his 8th grade math class a few months back. I saw this and thought why do they waste time with this? Now I know. Slope calculations are now burned into my memory. Thank you
@topdowndays
@topdowndays Жыл бұрын
Bosco. Thanks for the incredible instructions. I usually get about 90-100% on my own but when I'm stuck, I'm really stuck. It's great to have you helping me along.
@israelkolawole7144
@israelkolawole7144 Жыл бұрын
Bosco is a very vigilant and smart guy during Arduino tutorials
@EB-fd6rh
@EB-fd6rh Жыл бұрын
I know these videos are three years old, but I finally did one of your Hw assignments! I discovered the Arduino map function though, so I used that for the servo angles rather than the actual equation.
@TheSelfUnemployed
@TheSelfUnemployed 2 жыл бұрын
God bless you Bosco! Thank you for protecting Paul! And a million thanks to you Paul! I was laughing out loud when i got my laser to work! PEW! PEW! And Hello to all the new people I see are watching recently!
@georgemoertle3249
@georgemoertle3249 2 жыл бұрын
Thanks Paul.. Bosco is looking warm in his coat.
@frikkieventer9440
@frikkieventer9440 6 ай бұрын
Bosco. I have done the assignment, but used the " map-function" in stead OT the math. Worked fine. Also used a 3volt laser printer that I could switch on and of with analogieë. From South Africa. Enjoying the lessons with grandson
@raygarner6366
@raygarner6366 2 жыл бұрын
One more great tutorial. Got my wires mixed up at first. Then BOOM! Buzzer and all! Success! I did skip the ice coffee and had a nice large hot black coffee instead. Bosco who is properly dressed for Ottawa Canada would approved (it's -10F (-23C) ). Thanks for keeping it entertaining.
@williamharris5795
@williamharris5795 3 жыл бұрын
BOSCO I find the arduino lessons very good and appreciate the effort that Paul puts into producing them in a very well regulated rate to allow progressive learning.
@jonathanlanders9406
@jonathanlanders9406 Жыл бұрын
Bosco! For those interested in RC applications, I wrote this code entirely in variables. This allows you to adjust the max/min angle of the servos and the sensitivity of the joystick. It is not quite like I want it, but a work in progress. //Paul McWhorter Lessons //"New Arduino Tutorials: 33 Joysticks and Servos" //by Jonathan Landers //May 13, 2023 #include //Virtual Servos Servo Servo0; Servo Servo1; //Real Servos int servo0 = 7; int servo1 = 9; float servo0A; //angle out float servo1A; //angle out // Max/Min values for servo angles (Modify per project) float servo0Amx = 180; float servo0Amin = 0; float servo1Amx = 180; float servo1Amin = 0; // Servo Starting position (Modify per project) int servo0Astart = 90; int servo1Astart = 90; int delstart = 2000; // Joystick int Joy0x = A4; int Joy0y = A5; int Joy0xV; int Joy0yV; int Joy0sV; // Max/Min values for joystick potentiometers (Modify per project; Controls Joystick sensitivity.) float Joy0xVmx = 1023; //Ex. Max throw of 0 - 1023 float Joy0xVmn = 0; float Joy0yVmx = 911.5; //Ex. Less throw of 111.5 - 911.5; More sensative controls. float Joy0yVmn =111.5; int del = 100; void setup() { Serial.begin(9600); pinMode(servo0, OUTPUT); pinMode(servo1, OUTPUT); Servo0.attach(servo0); Servo1.attach(servo1); pinMode(Joy0x, INPUT); pinMode(Joy0y, INPUT); Servo0.write(servo0Astart); Servo1.write(servo1Astart); delay(delstart); } void loop() { /// JOYSTICK /// //Read values for Joy0 x, y from 0 to 1023 Joy0xV = analogRead(Joy0x); Joy0yV = analogRead(Joy0y); //Make sure Joy0 is within Max and Min values if(Joy0xV > Joy0xVmx) {Joy0xV = Joy0xVmx;} if(Joy0xV < Joy0xVmn) {Joy0xV = Joy0xVmn;} if(Joy0yV > Joy0yVmx) {Joy0yV = Joy0yVmx;} if(Joy0yV < Joy0yVmn) {Joy0yV = Joy0yVmn;} //Print Joy0 values Serial.print("Joy0xV = "); Serial.print(Joy0xV); Serial.print(" Joy0yV = "); Serial.print(Joy0yV); /// SERVOS /// //Calculate servo angles via linear equation between Joy0 and servos 0 and 1 servo0A = ((servo0Amx - servo0Amin) / (Joy0xVmx - Joy0xVmn)) * (Joy0xV - Joy0xVmx) + servo0Amx; servo1A = ((servo1Amx - servo1Amin) / (Joy0yVmx - Joy0yVmn)) * (Joy0yV - Joy0yVmx) + servo1Amx; Serial.print(" servo0A = "); Serial.print(servo0A); Serial.print(" servo1A = "); Serial.print(servo1A); //Write angle values to servo Servo0.write(servo0A); Servo1.write(servo1A); Serial.println(); Serial.println(); delay(del); }
@Mrerrol13
@Mrerrol13 3 жыл бұрын
Hahahahaha!!! Bosco seems like a nice guy, although he doesn't like the camera much!!!!! A long video tutorial but full of knowledge! Thank you very much once again, Paul!!!
@Adrian427
@Adrian427 4 ай бұрын
Made it to the end, Paul! Hay there, Bosco from New Zealand.
@haavishbonala10
@haavishbonala10 3 жыл бұрын
"BOSCO" I am 11 and got my Arduino kit yesterday, LOVE YOUR VIDEOS !!!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Good job!
@adamcurtice3584
@adamcurtice3584 2 жыл бұрын
This was a great project. I wound up digging through my scrap boxes and making 3 custom cables for the joy stick and the two servos. after seeing Paul's Servos flop around I decided to screw the bottom servo down to a piece of wood and used plumbers putty (aka pookey) to attach the top Servo. I used a large Alligator clip cover that slipped over the servo arm as my pointer. All this mechanical and electrical effort work great. Unfortunately I made one small mistake in my code that took me awhile to find. Only one Axis would work. I went through my wiring and my code several times. I verified both servos were in fact working. Finally I found that I had typed Xservo.write(WVx); Xservo.write(WVy);. When I changed the second Xservo statement to Yservo all was well in my world once again. ;) Bosco would have been proud. Having lived in East Texas since the eighties I have to say that anything below 60 begins to feel cold to me. Thanks for all your time, effort and energy.
@iseecrap
@iseecrap Жыл бұрын
Bosco! I made it to the end. Great lesson and I managed to complete this one on the end of tutorial 31 (except the buzzer!). It's all coming together nicely - thanks Paul
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Fantastic!
@russellford366
@russellford366 Жыл бұрын
Bosco!!! I never thought I would be able to learn to program! I'm still slow, but I am learning! Thanks, Paul!!!!!!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Happy to help!
@trumpatier
@trumpatier 3 жыл бұрын
Bosco looks like a nice guy. I encountered an extremely stressful error during this project. I set out to power my servos externally, and when I made the connections and uploaded my code, my joystick readings were way off, and my servos weren't responsive. I thought I fried my joystick potentiometer with the external power supply (4 AA batteries in series). Turns out the error was in my code - I accidentally attached my servos to xpin and ypin (the input pins from the joystick) rather than xservopin and yservopin. I found this out by comparing your code from the website to my code, so thanks a bunch for making that available! Everything works perfectly now :)
@joshuavergara6863
@joshuavergara6863 8 ай бұрын
BOSCO. I am having somuch fun watching your lectures. It brings me back to my teenage years when I was building basic circuits using the 555timer and getting schematic from radio shacks little book.
@hadi.merati
@hadi.merati Жыл бұрын
Thank you bosco! I controlled 1 servo motor using a twin joy stick on my own because of your teaching skills. I didn't have 2 servos. But for controlling 2 servos I just need to add some repetitive codes and it's not going to be that hard.
@richardalexander633
@richardalexander633 2 жыл бұрын
Bosco - Hi Paul went back and completed with the HiTec servos as they arrived a few days ago (but I kept moving through the remaining tutorials anyway as having so much fun)
@pathvalleyrailroad9277
@pathvalleyrailroad9277 2 жыл бұрын
I was able to refer to the previous lessons and hook this up before I even looked at the video. Thanks for doing these videos!
@pathvalleyrailroad9277
@pathvalleyrailroad9277 2 жыл бұрын
Bosco!
@adirajchalotra4916
@adirajchalotra4916 Жыл бұрын
Bosco! Paul, you are a true legend in keeping all of us watching till the end of your videos! Thank you!
@dghmrrinn951
@dghmrrinn951 3 жыл бұрын
Bosco is the best guard, because he does Math! And, math is VERY important! Paul, you are an amazing teacher, and quite the entertainer. Thank you for doing this series. And, I watch to end, everytime! Cheers, from the east coast of Canada!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Wow, thank you!
@scrappybobbarker5224
@scrappybobbarker5224 3 жыл бұрын
Bosco! Thanks for the great lesson. I enjoyed the X axis and Y axis servo project. I decided to mount an LED light on the side of the Y axis servo horn, and when you press the joystick button, the LED comes on, and there is a oscillating laser sound coming from the buzzer. Thanks again for all the time and effort that went into making this video.
@CarolinaDGF
@CarolinaDGF 3 жыл бұрын
"BOSCO!" These lessons continue to be entertaining and educational. I was able to hook up my single servo before watching the lesson. Will go back and add the second servo when Amazon delivers it. Great work Paul!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Great to hear!
@dubrocadidier4583
@dubrocadidier4583 2 жыл бұрын
.. BOOOOOOOM to BOSCO😎... Since I did not get my second servo on time and my buzzer was faulty , I decided to replace them with two LED lights (yellow and green) where I controlled the first servo with the X-direction of the JOYSTICK and then I analogWrite to the green LED so that its brightness increases and decreases by Y-direction of the JOYSTICK and finally the yellow LED comes ON when the SWITCH of the JOYSTICK is closed and then It is OFF when SWITCH of the JOYSTICK open. THANKS A LOT MR PAUL.
@alexdimov4729
@alexdimov4729 Жыл бұрын
Bosco! you are amazing at these videos and keep it up I'm only 15 and these tutorials are the best for people like me bc I like this kind of stuff. so continue what you're doing and I will watch till the end of the tutorials with pleasure.
@zachhamersley967
@zachhamersley967 3 жыл бұрын
Came for the Arduino training, stayed for the math lessons. If I don't have the slope of a line formula and the point slope formula memorized by the end of this series, I will be very angry with myself. Only had one servo but made it work both ways with WVx and WVy just for fun. BOSCOE!!!
Arduino Tutorial 34: Simplest Way to Use a Pushbutton Switch
10:26
Paul McWhorter
Рет қаралды 98 М.
Arduino Tutorial 35: Understanding How to Use a Stepper Motor
40:09
Paul McWhorter
Рет қаралды 294 М.
SPILLED CHOCKY MILK PRANK ON BROTHER 😂 #shorts
00:12
Savage Vlogs
Рет қаралды 46 МЛН
Challenge matching picture with Alfredo Larin family! 😁
00:21
BigSchool
Рет қаралды 41 МЛН
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 28 МЛН
КАКУЮ ДВЕРЬ ВЫБРАТЬ? 😂 #Shorts
00:45
НУБАСТЕР
Рет қаралды 3,1 МЛН
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
Arduino Tutorial 32: Understanding and Using Joysticks in a Project
24:25
Arduino Tutorial 30: Understanding and Using Servos in Projects
18:05
Paul McWhorter
Рет қаралды 241 М.
What is a PID Controller? | DigiKey
22:19
DigiKey
Рет қаралды 73 М.
Arduino Tutorial 37: Understanding How to Control DC Motors in Projects
31:25
Arduino Tutorial 25: Understanding Photoresistors and Photo Detectors
36:19
Arduino Tutorial 31: Using Servo in a Simple Project
37:51
Paul McWhorter
Рет қаралды 137 М.
Building the ENDGAME invisible PC
27:30
DIY Perks
Рет қаралды 2,7 МЛН
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
I Made A Water Computer And It Actually Works
16:30
Steve Mould
Рет қаралды 7 МЛН
SPILLED CHOCKY MILK PRANK ON BROTHER 😂 #shorts
00:12
Savage Vlogs
Рет қаралды 46 МЛН