Arduino Uno R4 WiFi LESSON 22: Control a Servo With Your Arduino

preview_player
Показать описание
Pick your Sunfounder kit up so you get the same results I do:

You can pick up the neat jumper wires I showed in the video here:

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:

In this video I show you how to control a servo using the arduino. We learn how to load libraries, and control the position of the servo. Enjoy!

#arduinor4wifi
#servo
#tutorial
Рекомендации по теме
Комментарии
Автор

Good day, I am Engineer. Your series on Arduino has made me a better Engineer. I would appreciate if you could start a series on ESP 32, because you have a unique way of teaching which is very very good.
Thanks.
Have a nice day.
Cheers

osayiunuarhemhen
Автор

Servos and robots are so cool. Thank you Paul.

qzorn
Автор

Walmart lawn chair abject failure - in Lesson 22 the servo is using the only 5V pin on the R4 UNO. Now I need to add the potentiometer but as per Lesson 12 that needs a 5V pin as well. Not risking frying my R4 by experimenting, so will have to head for the next lesson to find the answer... great lessons by the way.

pdaip
Автор

Thanks for the lesson! HW done but I will not make a video since I can no longer link to it here.

LorisHW
Автор

Hi Paul
Here is my homework for lesson 22. It's only 44 seconds long so I hope you (& The Guys) will take the time to watch it even though I can't leave a link.

charlotteswift
Автор

Can u please do arduino lessons on the elegoo 37 sensors kit V2.0 arduino, i wanna learn how to do them and i cant find good tutorials but then i knew who the best tech tutor is. love ur lessons btw

AshrayJK
Автор

This problem has been solved. Read the reply below. HELP: Last night I was working with R4 and put power in the wrong place. Not only did the R4 stop working but four other Arduinos are failing to load programs after clean compilations. They show that port is grayed out. I think I have destroyed a library. How can I remove both the old Arduino IDE and the new one so that I get a clean set of libraries?

robertschuldenfrei
Автор

I am seeing 18 or 19 steps from 0 to 180. Do these servos only have 10 degrees of resolution? If you Serial.print i in each For loop I observe that the servo does not advance from 0 to 10 degrees until i = 5. This repeats from there to 180 and then back to 0. Increasing dt to 1000 allow this to be more easily observed.

stevenog
Автор

I don't have time to post the video before the class on Thursday, but I am posting the code without the servo code. I will finish the circuit over the weekend and post it with the video. Notice that the equation of the line does not go through the (0, 0) point but has a negative intercept. That is because the potentiometer subtends an angle of more than 180 degrees.

// 23 potServo.txt

int potPin= A2;
int potVal;
int br= 9600;
int waitT= 100;
int angle;

void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(potPin, INPUT);
Serial.begin(br);
}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13, LOW);
potVal=
angle= .254*potVal-56.134; // This is the line with a Y intercept
Serial.print("potVal: ");
Serial.print(potVal);
Serial.print(" Angle: ");
Serial.println(angle);
delay(waitT);
}

robertschuldenfrei
Автор

Hello... I have a bunch of arduino stuff. I have to buy a new set of arduino's things to follow this course? But i have tinkercad just in case...

RicardoHernandez-ndpp
Автор

Hi, I have watched your past videos on auduino r3, I kinda just want to know that how to make your famous cold coffee.

KevalPattani
Автор

I have SG90 servo motors, they just spin continuously. Don't know if the Sunfounders are any different?

philluvschips
Автор

Sir, can you start a new series for esp32?

sanketkharade
Автор

Isn't it better to power the servo using an external power source?

KillerGuy