Using Servo Motor SG90 with Arduino

preview_player
Показать описание
This is the basic tutorial of Arduino to learn how to use Micro Servo Motor with Arduino.

I am using:
1. Arduino UNO
2. Micro Servo SG90
3. Jumper Wires

Project Page: coming soon
Рекомендации по теме
Комментарии
Автор

Code:
#include <Servo.h>

Servo myServo; // Create a servo object to control a servo motor

int servoPin = 9; // Define the pin to which the servo is connected

void setup() {
myServo.attach(servoPin); // Attaches the servo on pin 9 to the servo object
}

void loop() {
// Sweep the servo from 0 to 180 degrees in steps of 1 degree
for (int angle = 0; angle <= 180; angle++) {
myServo.write(angle); // Set the servo position
delay(15); // Wait for servo to reach the position
}

// Sweep the servo from 180 to 0 degrees in steps of 1 degree
for (int angle = 180; angle >= 0; angle--) {
myServo.write(angle); // Set the servo position
delay(15); // Wait for servo to reach the position
}
}

DylmorttYT
Автор

I REALLY GLAD THIS ONE IS JUST 1 MINUTE

ITS HARD TO SEE TUTORIAL LIKE THIS

really like ur video

DeletedChanneIs
Автор

code :
#include <Servo.h>

Servo myservo;

void setup() {
Serial.begin(9600);
myservo.attach(9);
}

void loop() {
int val;
while (Serial.available() > 0) {
val = Serial.parseInt();
if (val != 0) {
Serial.println(val);
myservo.write(val);
}
}
delay(5);
}

iAPixel
Автор

Are the little holes on the white adapter for screws? If so what screws would fit? M1?

cryora
Автор

Trying to make a reset arm for a knock down shooting target....any advice welcome

danielrizzi
Автор

will it be possible to drive max 72v20a stepper
or can you make one?

YILDIRIM-eu
Автор

Can someone help me what my servo motor keep rotating non stop

zaidkasbudi
Автор

so informative ...thanks for it. do you use instagram for technical posts?

abhijeetsuryawanshi
Автор

I need a sketch of arduino car to move

bernicesasu
Автор

Can I please ask for the Code? Need asap

wdjxijwke
Автор

chalange question i like video but i need human interface with out touching sofware mean i want three push buttons or momentry buttons if button one press speed one (20 what ever time change) if press button two it will wrk with speed two

mkr
Автор

avrdude: ser_open(): can't set com-state for "\\.\COM3"
Failed uploading: uploading error: exit status 1



what can i do?

venkatasaivinayneelapala