This is the connection👆
This is the code 👇
#include <Servo.h>
Servo myServo; // Create a Servo object
void setup() {
myServo.attach(9); // Attach the servo to pin 9
}
void loop() {
myServo.write(0); // Move to 0 degrees
delay(1000); // Wait 1 second
myServo.write(90); // Move to 90 degrees
delay(1000);
myServo.write(180); // Move to 180 degrees
delay(1000);
}
You can order a Servo motor from Ali express link is below 👇
SG92R Micro Servo Motor 4.8-6V 360/270/180 Degree Continuous Rotation Controllable Angle for Robot RC Drone Aircraft Model 9g
Price Now: LKR 292.53 (Original price: LKR 732.81, 60% off)
🔗Click & Buy: https://s.click.aliexpress.com/e/_oF0sB5z
No comments:
Post a Comment