Arduino Tutorial 31: Using Servo in a Simple Project

  Рет қаралды 141,850

Paul McWhorter

Paul McWhorter

Күн бұрын

Пікірлер: 865
@drsmith3411
@drsmith3411 4 жыл бұрын
The "math" part is really important. Keep showing it!
@AppieBing
@AppieBing 4 жыл бұрын
yeah
@Anonymous-yy5qr
@Anonymous-yy5qr 3 жыл бұрын
Yes
@shabiiturk7723
@shabiiturk7723 3 жыл бұрын
@@jurgenbaert8197 Yes, Same here
@jerrypeng8215
@jerrypeng8215 3 жыл бұрын
Easy math but it works perfectly
@RD_royale
@RD_royale 2 жыл бұрын
the most important
@richthofen9592
@richthofen9592 7 ай бұрын
Hello, Mr. Mcwhorter! I just wanted to tell you that in my entire life I´ve never got excited when someone tell me "This is the homework/assigment for today" but you are the first person in all the world which make it happen. After just some minutes I did the "homework" before watching this video and I just got a lot of fun doing it. I even tricked my dad make him think that I was controlling the servo motor rotating the lamp that I have in my desk before telling him that it was the light produced by the lamp which made it move and the angulation of the lamp made the photoresistor get more or less light (which to the servo was translated to rotation degrees) depending of the rotation. Thank you! Mr. McWhorter. I could say that these are the best videos in all youtube.
@karlgross877
@karlgross877 4 жыл бұрын
I did the math and I also added "if" statements after calculating the angle so that it would for sure stay within the range of my servo (15 to 165 degrees) in case the lightVal was higher or lower than my x values I used to find the slope.
@Rebius
@Rebius 3 жыл бұрын
me too :)
@terminatorpg1067
@terminatorpg1067 3 жыл бұрын
Same :)
@venkateshdeshmukh4605
@venkateshdeshmukh4605 2 жыл бұрын
Same here(❁´◡`❁)
@rizamavictor5852
@rizamavictor5852 2 жыл бұрын
Me too :)
@MixwellSidechains
@MixwellSidechains Жыл бұрын
Me too
@GeoGebweiler
@GeoGebweiler 5 жыл бұрын
Hello Paul. I did the assignment and it works. I'm so happy and proud about it. Thank You for Your lessons. Three weeks ago I did not know anything about the Arduino and now I develop to a little expert. You are a great teacher and I am really happy that I have found these tutorial on KZbin. Please keep on with this series (y)
@nerdape7314
@nerdape7314 4 жыл бұрын
"You see why I was in engineering and not in Art class" SirPaulCleverness = analogWrite(hisIQ, 1023);
@charlielowell4077
@charlielowell4077 2 жыл бұрын
I did the assignment too. I can't begin to tell you how much I really appreciate you doing this to help us all learn. I'm an old guy and retired recently and i'm a 2nd time watcher of your Arduino videos. I started out about 7 or so years ago with Arduinos and learned a great deal from all of your older series. I got away from microcontrollers and microcomputers while I pursued 3d printing and laser engraving for a few years. My electronics bench has been calling me for the last few months so, when I needed a refresher, I knew to look back to you and I'm very pleased that you've got a new series! That said, I cheated a little on the assignment. I didn't forget everything I learned from my Arduino past. I remembered the "map" function and mapped the analog read from the LDR to the values of my servo's range (senseVal= map(analogRead(sensePin),0,1023,0,175);). The sketch works great and I owe it to you for being able to get me back into the coding saddle! I see you also have a new Python series too!. I'm going to get into that one soon and I know that I'll benefit from both of these great video sets. YOU ROCK! Thanks again!
@tobinsexton6246
@tobinsexton6246 3 жыл бұрын
I've been following this series since lesson one, and I have never been so engaged in doing homework! Half the time I make my code more complicated than it needs to be, and have a good chuckle when you show how easy it is. This one was actually pretty easy in relation to the button switch. I appreciate the need to brush up on my algebra, as it has been far too long! Thank you for your time and knowledge!
@bearpapa1606
@bearpapa1606 3 жыл бұрын
I'm a bit proud of myself. I was able to not only finish the assignment, but I also wrote a code that set up the min~max photoresistor value by itself depending on the light level. whenever the code detects a smaller min value or larger max value, it will rewrite the minmax photoresistor value. being able to start utilizing the knowledge that I learnt from your previous tutorial feels really great. can't wait to finish all the tutorial.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Great idea.
@simontopley4771
@simontopley4771 11 ай бұрын
Any chance of sharing the solution to this please?
@reinodupreez264
@reinodupreez264 Ай бұрын
Hi Mr Paul McWhortwer for the first time i got the project to work by myself had to go back to previous projects and notes to get it right!!!! Haven't felt so proud of myself in a very long time since i was declared medically and mentally unfit for duty as an electrician this hit me hard my mental health has been a uphill battle. Today was a major accomplishment for me THANK YOU FOR THAT!!!!!! did not watch this video jet so very exited to see if there is another way...
@corneliuschamberlainmarcou6127
@corneliuschamberlainmarcou6127 Жыл бұрын
Hello Paul. I did the assignment and I also added an if statement to print out the weather based on the angle value. thanks very much for your time. 💯
@raultrevino8576
@raultrevino8576 5 жыл бұрын
This is amazing man, im 2 years in to my mechatronics engenieering major here in Mexico and this videos help me to rembeber the basics! Thanks a lot!
@giftmumba6859
@giftmumba6859 3 жыл бұрын
AM GLAD WE ARE BOTH MECHATRONICS ENGINEERS WATCHING THESE VIDS...
@adamcurtice3584
@adamcurtice3584 2 жыл бұрын
Once again I got my homework done without cheating. My math was a bit crude but I referred to some of the older projects and got it all to go. the arm swings right as the light goes out and left as it gets brighter. Mission accomplished. Another satisfied customer. :)
@autocrosser10
@autocrosser10 9 ай бұрын
I got this one working prior watching any of lesson 31. The code was easily created by referencing a few other lessons. The math is pretty easy at this point. No complaints from me. Enjoyable lesson, seeing all of the previous lessons come together is very rewarding.
@jaydusterhoff2795
@jaydusterhoff2795 2 жыл бұрын
I was able to do the assignment on my own, with a little review from my notes. I realize you are now done with the video series but I am glad you don’t listen to the complainers and keep showing the math and being in depth with your explanations. Very helpful. I was telling my dad about your videos and he made a good point. He said some people are really smart but can’t teach. You sir are very smart and do a wonderful job teaching. Thank you for sharing your knowledge.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Great job!
@dougweaver8773
@dougweaver8773 Жыл бұрын
Hi Paul. I did the homework, drew the curve, derived the equations, wrote the code, and it works! That was a pretty cool example to work through. Thanks again for these lessons!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Fantastic!
@carlcallenburg7898
@carlcallenburg7898 2 жыл бұрын
I help students with math and at one point I was a teacher. I always get /got the question, "Why Do We Need To Learn This Stuff?" I always agree with the student asking because it is a fair question. I would like to share your lesson with the next student to ask me. You answer the question. Why? ... So we can do things like this!! Thank You Keep it coming ....
@jamesunsworth00
@jamesunsworth00 5 ай бұрын
You are doing such a service!! Thank you so much for being such a wonderful teacher. Your style of teaching is perfect for me; the way you explain not only what, but how and why, the way you repeat important points and even important points from previous videos. Really helps to job my memory. I always do the homework and I love doing it, it works out for me 95% of the time but that toggle switch a few episode back had me struggling. You sir have a gift for teaching
@rawadhasan9111
@rawadhasan9111 3 жыл бұрын
I did the math by myself. I had to fix it after watching because I switched light with dark weather. I really love the fact that you explain the math and science behind engineering. It makes my education feel useful. Thanks Paul!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Great job!
@zainharabeh121
@zainharabeh121 Жыл бұрын
I did it by my self because of your good teaching and this is my code ; #include Servo myServo; int servoPin=9; int PRPin=A0; int servoPos; int PRVal; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(PRPin,INPUT); myServo.attach(servoPin); } void loop() { // put your main code here, to run repeatedly: PRVal=analogRead(PRPin); servoPos=(180./1023.)*PRVal; Serial.print(" servoPos = "); Serial.print(servoPos); Serial.print(" PRVal = "); Serial.println(PRVal); if (PRVal==PRVal) { myServo.write(servoPos); } if (PRVal==PRVal) { myServo.write(servoPos); } }
@melvinsajith4448
@melvinsajith4448 4 жыл бұрын
I did the assignment and it works. I using if statements. Thank You for Your lessons. you are a great teacher and I have never attended a course like these. I love it.
@allengerhard9513
@allengerhard9513 6 ай бұрын
I did the home work assignment. I'm happy to say i got working. Im patting myself on the back.( but i did have to go back to see certain things make sure i was correct) so far this arduino tutorial is great. Im 4 years later and almost 40years old still learning new things. This is awesome. Thank you for what you did for us. Sry i dont comment very often but i felt i needed to this time.
@paulmcwhorter
@paulmcwhorter 6 ай бұрын
Great job!
@danielhedger6060
@danielhedger6060 4 жыл бұрын
Did this on my own and got it right. Math is good, necessary, and important. Thank you for explaining the math behind these projects Mr. McWhorter.
@loptica62
@loptica62 5 жыл бұрын
I am going to nominate you for an Oscar....
@AvnishKumar-in9io
@AvnishKumar-in9io 4 жыл бұрын
Oscar of technologies, electronic, robotics
@anews4898
@anews4898 4 жыл бұрын
@@AvnishKumar-in9io aka everything that is important :)
@michaeldalfonzo3912
@michaeldalfonzo3912 3 жыл бұрын
I did build the project and coded it to get it to work. I'm not good at math, so I used a series of if loops to set the angle for the servo. Worked just fine. Replaced the if statements with the calculation and of course it worked. Really enjoying these lessons.
@steviekiss3609
@steviekiss3609 8 ай бұрын
I am happy to say that, thanks to your wonderful tutorials and teaching style, I completed the assignment by my self! And it worked on my first try! Thank you so much for having this high quality and accessible technology education available to students.
@paulmcwhorter
@paulmcwhorter 8 ай бұрын
Wonderful!
@xtrimekiller5877
@xtrimekiller5877 4 жыл бұрын
I had to follow along with you as I struggle with the math on my own , thanks for teaching me Mr McWhorter !
@thunderbolt8582
@thunderbolt8582 5 жыл бұрын
I am very experienced in using servos with Arduino controls. I think you did a great job explaining the math and placing it into the code. I understand the use of the kit servo and using the Arduino to power it. However, my experience is that servos typically can be troublesome when using the 5v Arduino power source. So I just want to mention that in general, the best practice is to use a separate 5 volt supply for the servo. If people follow this tutorial and try to use more power hungry servos, they will run into problems. So I think you did a great job on the tutorial and you might want to consider a lesson using a power hungry servo and show how to connect a separate voltage source. Again, nice work!!!
@simontopley4771
@simontopley4771 Жыл бұрын
Paul did say this at the very beginning, our kit servos are only cheap learning tools.
@richardjenkins8728
@richardjenkins8728 2 жыл бұрын
I did the homework :) Worked out great, put IF statements to limit the servo no less than 10, and no higher than 170. Thank You for your wonderful tutorials!!!!!!!!!!!
@MarvPerk3
@MarvPerk3 3 жыл бұрын
Paul, I did this on my own successfully! I also decided to add an RGB LED (from what I learned in that lesson) so the RGB would glow brighter as the room got darker... aka almost a practical application! The very great news is that I had to do 2 different slope calculations, one for the servo and one for the RGB... and I did it, thanks to your excellent teaching! I don't think I can upload a photo, but I did create a little dial face to go on the servo, and did the ping pong ball on the RGB... so I'm very proud of the result. Adding a servo really got me going! Just as much fun to then watch you do it and see that I did it acceptably!
@kevindegoede9144
@kevindegoede9144 4 жыл бұрын
I have really enjoyed the progression from dimmable LEDS to moving the servo based on light intensity. What I have found informative is the development of a program. Apart from trouble shooting testing each section and then going on to the next has made a big difference to my designing my own programs. Thanks for step by step tuition. I am learning every time. Boom! My projects are starting to work with far less frustration.
@dougbrubacher5198
@dougbrubacher5198 3 жыл бұрын
I did the homework (and the math) and it works!...even got an "oooo, ahhhh, from my son in systems design engineering! Used a potentiometer in place of the 5000 ohm fixed resistor so I can adjust the sensitivity to light / darkness. Thanks for another great lesson.
@whilson8857
@whilson8857 3 жыл бұрын
i did it like that: angle = lightVal/5.5; It works almost the same way. Paul, your lessons are amazing. You are a great teacher!
@fabquenneville
@fabquenneville 3 жыл бұрын
Homework done before the video 31! Its Alive!!!
@paulbrouyere1735
@paulbrouyere1735 4 жыл бұрын
Hallo Paul, you are a great teacher. I was sitting next to a programmer the end of the ‘90’s. We were programming 8086 technology under DOS and Assembler. Love your videos, always learning again too. Thank you, you explain really well, and it doesn’t take long before you correct yourself. Great!
@tonyperry6702
@tonyperry6702 4 жыл бұрын
the homework was a success. servo was responding to available light quite nicely. thank you for all of your hard work putting these videos together.
@EdwardRLyons
@EdwardRLyons 3 жыл бұрын
I commented on the previous video that I did the homework, so before getting to this video. The maths is very straightforward once you've practiced it a few times. The more projects that depend on doing it, the easier it becomes. It's far easier than working out the more abstract logic that needs to be applied in coding. That's where I struggle! Thank you for this excellent series! I've learned far more coding and building simple circuits in the past two or three weeks than in all my previous efforts in either! On to the next lessons!
@srduke
@srduke 5 жыл бұрын
I get more satisfaction from working out the equations than just using the mapping function.
@noway9610
@noway9610 5 жыл бұрын
wow first time in YEARS i am not afraid or discouraged to tackle math and it make sense! i have always been an "I hate math" kind of guy but here we are making it practical and it is changing my opinion. thank you
@yolandanelson31
@yolandanelson31 4 жыл бұрын
I had to do the math with you because I didn't do the HW correctly. I only made my servo do sunny and dark. I didn't pay attention to the ending of the last lesson. I will do better lol and pay more attention to you near the end, I just get so excited that what we did during the tutorial worked. Keep doing the math, the electrical diagrams, and everything else that shows us the how and the why!
@misterdecaro
@misterdecaro 2 жыл бұрын
I enjoyed this assignment! I tried the servo code then copied and added it to the light detector circuit that sets the red and green LEDs and buzzes with the change in light condition.... My favourite part was determining the equation of the required angle with respect to the read value of the light resistance.
@dannycollins5698
@dannycollins5698 Жыл бұрын
I love mathematics. I love computers. This series is wonderful. I want to add that engineering mindset. I'm starting to love the physical computing/robotics side. Controllers-->Actuators-->Environment-->Sensors--Controllers-->etc. This loop is great to think about. Thank you!
@hasan-motam
@hasan-motam Жыл бұрын
Thanks Paul. I did the assignment on my own. Took me a while to figure out how to connect both the photoresistor and the servo to the 5V power supply.
@IanReeves78
@IanReeves78 3 жыл бұрын
Thank you for another great session Paul. I did on my own, using the math, and then added a RGB LED to display green for bright, blue for dull and red for dark. I then used the map command to get the angle. I'm enjoying your videos.Ian.
@erenknl
@erenknl 10 ай бұрын
Thank you so much Paul, I did the homework and I'm so happy with that. Keep going what you're doing, your videos are so helpful for me!
@kenmeyer100
@kenmeyer100 3 жыл бұрын
After I left the delay statements out, the movements were very smooth and it was fun to watch as I moved my hand around the photoresistor like a conductor
@pathvalleyrailroad9277
@pathvalleyrailroad9277 2 жыл бұрын
I did the math a bit differently. I had light values between 0 and 780, so at first I used 180/780*lightVal and I got 0 degrees at light val 0 and 180 degrees at light val 780. To reverse it I used (-180/780)*lightVal+180 and that worked just fine. I am really enjoying this series, thanks for making it!
@JohnyRalte
@JohnyRalte 3 жыл бұрын
Sir, I just revisited lesson 30 and 31, and realize that you didn't use pinMode for Servo control pin in lesson 30, but it still worked fine. And then, you used pinMode for Servo control pin in lesson 31, and again it worked. I'm a bit confused on whether declaring pinMode is compulsory or not, for a Servo motor control pin. Thank you. Great video as always.
@tretty07
@tretty07 4 жыл бұрын
Absolutely loving the series, I did the assignment and it worked perfectly, took me a little while to figure the math right but eventually got there. #include int lightR = A0; int lightValue; int dt = 500; int servoPin=3; int servoPos=0; Servo myServo; void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(lightR, INPUT); myServo.attach(servoPin); } void loop() { // put your main code here, to run repeatedly: lightValue=analogRead(lightR); Serial.println(lightValue); servoPos=(180./260.)*lightValue - (40.*180./260.)-27.6; myServo.write(servoPos); }
@shatterism3329
@shatterism3329 Жыл бұрын
Hello Paul, I did the homework by myself using what I have learned so far on your past videos. I'm a month away before going to college. I hope the professors teach the same way as you do.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Fantastic!
@larrywu9207
@larrywu9207 Жыл бұрын
Hey Paul! My entire class is using your tutorials to learn arduino and we love it! We’ve learn so much and the math is so helpful❤❤
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Nice work!
@robertparker5369
@robertparker5369 5 жыл бұрын
Great job Paul. Did the homework and the math and enjoyed it. Even put endpoints in [if (angle>180){angle=180;} ] , etc. Need more homework to keep us busy through the week!
@loptica62
@loptica62 5 жыл бұрын
what you (we) actually need is more ideas for use....
@higuy2k
@higuy2k 4 жыл бұрын
Good idea on the endpoints, I did the same in my code. Matt
@oldcrazyeye6482
@oldcrazyeye6482 3 жыл бұрын
i did the assignment. it works!!!! i probably didn't do it the way you would have but i'm proud that i actually made it work.
@georgeshaiffer2246
@georgeshaiffer2246 3 жыл бұрын
Paul, Please do not reduce or eliminate the math content. Although I have what I consider a good math foundation it is refreshing and informative for me to see the application and a review doesn't hurt. A valuable part of your presentations. Many younger users of your Tutorials will learn and use some of the math long before their school includes in their classes. They will feel very good about themselves when this happens.
@mohdarshath8992
@mohdarshath8992 Жыл бұрын
Did it with ease. Finished the code in 10 lines. Thanks Paul
@yasins8713
@yasins8713 4 жыл бұрын
i did not shut the vid when u started doing math :-) . why your servo motor is not moving smoothly because there is a delay, if there is no delay the servo moves smoothly (i am talking about 36:23). thank you for this awesome tutorial and i am looking forward for the next vid
@ricardosanchez1638
@ricardosanchez1638 4 жыл бұрын
I did it by using information from Tutorial 26. Most of the information is there. I was really interested because I am working on a project that will include a mechanism for tracking the sun for a solar panel robotic system. Loved the Tutorial! Thank you very much Sir!
@rukidding7588
@rukidding7588 4 жыл бұрын
I really do appreciate Paul showing all the high school math. Some people never got it in high school, and many others have forgotten it. It is important in order to understand the principles behind the projects. That said, no, I didn't do the math. Years of doing this sort of thing has given me a kind of intuitive feel for it. So, like Paul, I first got my light sensor readings (100 - 1000). Then, realizing I have to map those values over only 180 degrees of servo movement, I calculated (1000 - 100)/180, which VERY conveniently comes out to 5. So, that told me I have to divide my light sensor readings by 5. I decided I wouldn't bother with floating point values. I figured integers would do for this project. One thing I didn't like was the fact that the servo goes counter-clockwise as the angle value increases. This would mean the pointer would point completely left in sunlight. I like low on the left and high on the right, so I calculated the angle and then subtracted it from 180. This made it so the angle gets smaller & smaller as it gets brighter. Works like a charm. My command was: sensorVal=180-(analogRead(sensorPin)/5); I then checked to see if sensorVal is greater than 180 or less than 0. If so, I set it to 180 or 0 as appropriate. This was a fun project. Thanks Paul.
@klmyself
@klmyself Жыл бұрын
Paul, I had solved this a little differently; I used light range in my room (near 0 to 800) for the evaluation angle = (lightVal/800)*180.; . I reversed connections (llight sensor to ground, resister to 5 volts. That gave the same result as the negative slope calculation. I added the If limitations so as the keep to the 180 deg limit of the servo. Thanks for your tutorials, I'm learning something.
@ralphmarks2727
@ralphmarks2727 2 жыл бұрын
started writing out the math, over and over. I don't learn as fast as I should, making a poster of slope formula! Thanks you so much! Hope you are finding God's blessings in Africa.
@aynursunagatullin7029
@aynursunagatullin7029 4 жыл бұрын
Mr. McWorther, I did the math and code and I did it pretty well! I am so happy with my results. #include Servo myServo; int servoPin=9; int lightPin=A0; int lightVal; float servoPos; int dt=100; void setup() { // put your setup code here, to run once: pinMode(lightPin,INPUT); myServo.attach(servoPin); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: lightVal=analogRead(lightPin); servoPos=(180./550.)*lightVal-(180.*200./550.); myServo.write(servoPos); Serial.println(lightVal); delay(dt); }
@vidhanmaheshwari2082
@vidhanmaheshwari2082 5 жыл бұрын
Sir I did the math and completed the project but I had some problem in my servo ... I ordered it and it came today and made the project just an hour before and here you are...Thanks.
@thefierceninja2557
@thefierceninja2557 2 жыл бұрын
I also did the math with a limit on how far it can go, works perfectly. keep making amazing lessons!
@brikozub
@brikozub Жыл бұрын
I rewrote what we made in the last lesson. The servo would start at 0 and increment by 1, until it reached 180. Then, the servo would do the same in reverse. When it reached 0 again, I asked the user for a new increment, before doing the same process, using the provided increment. I did that before you gave the homework assignment, so I decided to let the increment level be decided by the level of light. If it's bright, the servo increments quickly through the cycle, and if it's darker, slower. The more complicated the circuits are, the more exciting the programming gets, because there's so much more room for exploration and finding different solutions to the same problems.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Excellent!
@zada.2008
@zada.2008 2 жыл бұрын
I did the homework! I really enjoyed doing the math and seeing everything work out! You're really helping me out with being able to overcome obstacles while trying to solve these problems.
@StefanEckhardt-y6r
@StefanEckhardt-y6r Жыл бұрын
Hi Paul, I did the math....and I did it on my own! First time in my life I understood how to use the math....and it makes fun! Thank you so much! Having a lot of fun with your excercises!
@markloyd8616
@markloyd8616 4 жыл бұрын
I did the math based on the previous lessons and it worked great! One thing: when I hooked up my circuit, I wired it so that the +5v goes to the fixed resistor first, then grounded the photoresistor. This gives you a positive slope and makes the math easier.
@yusufguler1662
@yusufguler1662 4 жыл бұрын
I did the homework and please don't stop your lessons they are amazing
@scottcassidy8471
@scottcassidy8471 3 жыл бұрын
Did it! I couldn't follow the math (it had been too long since learning it in school) back in lesson 25ish, so I took a day to go through Khan Academy's linear algebra lessons and I'm glad I did. The math is so useful and actually makes these projects possible.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Great job!
@Ameer5CT
@Ameer5CT 3 жыл бұрын
I always do the homework and focus on every second of the videos. I really benefit from the course. Thank you very much for all of that but I don't know what to comment so this is my first one here. Maybe there is a lot of people who watching silently like me I hope you read that
@dannycollins5698
@dannycollins5698 Жыл бұрын
Did the assignment! Because you told me to. You're the teacher, the boss. I am the student. I do what you tell me. 😃 Loved doing the Math.
@blakerogers2608
@blakerogers2608 4 жыл бұрын
Did the homework before watching this video. I had to troubleshoot a bit as I kept using the wrong coding to write the position to the servo, but finally figured it out! Thank you for the great lessons!
@Abv1911
@Abv1911 3 жыл бұрын
Did it myself but never thought that I would have such a great teacher
@erikburman530
@erikburman530 2 жыл бұрын
I am math challenged so I really appreciate that you have especially emphasized the line-slope equation for the last several sessions. I have made it a point to do the assignments ahead of time and work through the line equations prior to your explanation. I think it has finally soaked into my brain. Sure it would be simple enough to use the map() function but the Aha! moments are so much more rewarding. I am surprised that an engineer like yourself didn't go into much detail about how servos work. But I guess there's only so much information you can pack into all this.
@geralddrake4617
@geralddrake4617 4 жыл бұрын
Yes, I did the math ahead of lesson 31 and I got my servo working with the photo cell light value. Fun project. I love how you apply math principles to programing for that is the real world.
@thethubbedone
@thethubbedone 4 жыл бұрын
I coded this and had it working prior to watching, and I added variables for the servo's min and max angles, as well as the min and max light readings, then made the arduino do the math for me. using this line Servo_Angle=(Position_Val_Max/Light_Val_Max)*Light_Val; Thanks again for shooting these videos
@BlueDeeVo
@BlueDeeVo 4 жыл бұрын
Paul I've been watching this whole series from the beginning and haven't commented yet but I had to comment this time because I was so proud that I was able to do the math and the homework assignment. Thank you!
@johnellick7362
@johnellick7362 Жыл бұрын
The arrow demonstration going from the sun to the moon was a great visual teaching method. You made a complicated lesson very clear to understand. I do admit my math skills are very limited, but I do understand the importance of the math (nuts and bolts) in programming code, so I follow along as best I can. Wish you had been my math teacher in High School. I probably would have had better grades. lol.
@LeonJakub
@LeonJakub 3 жыл бұрын
I did the math (following a refresher on linear equations, as I haven't done them for 35 years!). Project worked great!
@jadersoares3659
@jadersoares3659 Жыл бұрын
Dear Professor Paul, I managed to do the homework, I had some time without being able to study due to everyday tasks, but I am committed to learning, God bless you.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Excellent!
@kageshirou
@kageshirou 3 жыл бұрын
I was able to figure this out based on the math you taught me in previous lessons! Many thanks!
@mightythimble4942
@mightythimble4942 5 жыл бұрын
Paul your videos are phenomenal! I bought the super starter kit BEFORE I found out about your tutorials and just happened to find your videos! I had some trouble during lesson 13 because the potentiometer that came with my kit doesn't get a stable connection with the bread board and my LED seemed to be turning on and off at random, even when I removed the potentiometer entirely. I came to find out it's called "floating pin" voltage/signal. I thought "how in the world could a toggle switch or push button work with the arduino if an activated pin hooked up to an open circuit can be randomly triggered by floating pin signal???" then later in your series you explained pull up and pull down resistors and it all made sense! I really hope you do a tutorial on shift registers! Nobody else I've found has been able to present all this information in such an easy to follow way! Keep it up, paul! Big fan!
@akosslemmer4603
@akosslemmer4603 3 жыл бұрын
Homework completed, this one was way easier than the previous two, since there were no "new" logic involved. I'm about to make a "useless box" as a birthday present for my friend, and writing the program now won't be a challenge. Assembling it is another topic, but I'm pretty sure it'll be neat. Thank you again for all these content! :)
@DailyLifeCaption
@DailyLifeCaption 2 жыл бұрын
Hi Paul, I did assignment before watching this videos to verify if my maths calculation is correct. it's all thanks to knowledge that i have learnt from you on previous tutorial . I strongly agreed that explaining how's the maths work is really important as it let us understand how to find the ratio of y-axis to x-axis .Love your tutorial as it really detailed and funny . I would also like to suggest to put Formula , Minimum and Maximum value for servo angle and photo-resistance in the code as it would ease to review and check the codes and less mathematical errors. Anyway i do really wish if you could continue with this Arduino tutorial series. Stay healthy. Below are my arduino codes: #include int servoPin = 6; float servoPos = 0; Servo myServo; int waittime = 500; //x1,y1 float minLightres = 50; //x1 float minAngle = 0; //y1 //x2,y2 float maxLightres = 885; //x2 float maxAngle = 180; //y2 float gradient; int lightPen = A0; int lightVal; void setup() { // put your setup code here, to run once: Serial.begin(9600); myServo.attach(servoPin); pinMode(lightPen, INPUT); } void loop() { // put your main code here, to run repeatedly: lightVal = analogRead(lightPen); Serial.print("lightVal :"); Serial.println(lightVal); //Formula : (y2-y1) / (x2-x1) gradient = (maxAngle - minAngle) / (maxLightres - minLightres); servoPos = (gradient * (lightVal - minLightres)) + minAngle; Serial.print("servoPos :"); Serial.println(servoPos); myServo.write(servoPos); delay(waittime); }
@johndean2170
@johndean2170 4 жыл бұрын
Sunny > Cloudy > Banana Love your tutorials Paul! Thanks!
@bill6590
@bill6590 3 жыл бұрын
OK, I did the homework and made it work correctly. It took a little thinking, a little math, and frustration. But, I did it, and it worked. It helps to do homework after the subject matter has been discussed. That way you can use it to learn something. Instead of in one tutorial, trying to solve a problem without being given all of the necessary command information. This approach works much better. Plus, you get to see the answers in the very next video.
@eladioh3858
@eladioh3858 3 жыл бұрын
I did the homework !!! had to go back to remember a few things, it paid of. Thank you for all the hard work that you put in to your Videos.
@gregcosner-p2g
@gregcosner-p2g 11 ай бұрын
I did the homework. It worked. I used a positive slope referencing lesson 26. My math is a little rusty, but thanks for explaining it so well.
@PedroLuis-yp9ed
@PedroLuis-yp9ed 3 жыл бұрын
The math was really discouraging but learning to do it, plugging it into the code, and seeing something physically happen because of it just makes it all magical like lol. I was a genius at math in high school and threw it all out my brain because the teachers always just told us to shut up and learn it without giving us any applicable scenarios. Then college I learn about this, and they omitted the math. Years and 30K waisted on college for nothing, and here a teacher putting it all together for $0....I wish in the end it could be your signature on my college diploma. Thanks again for doing this.
@Antivirus-uk3rx
@Antivirus-uk3rx Жыл бұрын
This one is custom built to your room, "the math" is important for this and i did it with ya! Starting to feel like im getting somewhere with my arduino!
@danwolfe7665
@danwolfe7665 3 жыл бұрын
I finished the homework prior to this so I had a Margarita during this video instead of the coffee.
@ibrahimtijjani8331
@ibrahimtijjani8331 2 жыл бұрын
Hello Paul, you are indeed great Teacher since when I started following your videos here, I've been improving day by day, I've done my assignment but different way I used two if statement and it works
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Great job!
@zakm
@zakm 2 жыл бұрын
Did the homework! Servos are my favourite component so far.
@michaeltue3176
@michaeltue3176 2 жыл бұрын
I did the homework, mostly by myself I got the M-slope value but point-slope equation is a bit harder to solve as my algebra is a bit rusty. I used an online slope calculator to help to get the line equation. The programming part was all good. I am doing some more algebra lessons, so soon should get the hang of it too. Thank you for your time making the lessons.
@lorisrobots
@lorisrobots 2 жыл бұрын
I was able to complete the assignment before watching the video. I really liked your drawing! Thanks for another wonderful lesson!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Great job!
@chrisgosling5408
@chrisgosling5408 2 жыл бұрын
I like the addition of the maths, no pun intended. it helps to build the picture. In engineering it is important to understand the problem. You solve the problem and action this using the code!
@gonnieben-tal8186
@gonnieben-tal8186 8 ай бұрын
Thanks for making this video and for sharing it with us! I think that we should include a couple of "if statements" in case the angle becomes greater than 180 or less than 0 to make sure we keep the values we're inputting into the servo within their allowed range.
@ericroque5813
@ericroque5813 8 ай бұрын
I did a different math. I measured the resistances at both ends and divided it to a number, did the same at the servo's angle from 0 to 180 so each levels of lightVal will match the angle of the servo. I used IF function to "box out" two values so that servo would not go back and forth when light is insufficient to be detected. I would say this is best for light activating circuits when the intensity of light source is constant but if the reference light might change every other day like the daylight, this is inapplicable as you would change the values in your program. Nonetheless, you are awesome Paul. Thank you for this. If you existed on my KZbin decades ago, I would've created great devices. hahaha
@kirstinlee6838
@kirstinlee6838 10 ай бұрын
This was a great project! I was able to set up my board before you showed the video. I really appreciate the math because it helps me understand how it works. Thank you so much!
@Ethanstonge
@Ethanstonge Жыл бұрын
i did the homework in like 10 mins thank you for explaining it the way you did and also you liked my comment from the last vid i watched adn that made my day. you actually care about your audience and it rocks
@Jim-mn7yq
@Jim-mn7yq 4 жыл бұрын
Did the math and project before I watched you do the project and it worked. It's lots of fun and am really enjoying the series.
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
Рет қаралды 248 М.
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 2,7 МЛН
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 27 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Arduino Tutorial 29: Using Push Buttons to Create Dimmable LED
41:38
Paul McWhorter
Рет қаралды 144 М.
Arduino Tutorial 33: Understanding How to Control Servos with a Joystick
49:14
Arduino Tutorial 35: Understanding How to Use a Stepper Motor
40:09
Paul McWhorter
Рет қаралды 302 М.
Analog Feedback Servo Motor - Improved Servo Performance
23:15
DroneBot Workshop
Рет қаралды 81 М.
How to Use Arduino Interrupts The Easy Way
33:28
Rachel De Barros
Рет қаралды 90 М.
Arduino Tutorial 28: Using a Pushbutton as a Toggle Switch
21:58
Paul McWhorter
Рет қаралды 296 М.
【For Beginner】How to start electronics and what item is needed
18:16
Arduino Tutorial 48: Connecting and Using an LCD Display
50:43
Paul McWhorter
Рет қаралды 182 М.
“Hello, world” from scratch on a 6502 - Part 1
27:25
Ben Eater
Рет қаралды 4,8 МЛН
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 2,7 МЛН