Load test, just for demo. Excessive weight, may damage the circuit
Test normal command, for Servo Motor 180 degree Arduino Uno or Arduino Nano
Below command without problem.
On Arduino Nano and Arduino Uno.
Servo Motor turn 180 degree, no need special command
Just put myservo.attach(7) // pin 7
And servo angle, example turn 180 degree
Command to be
my.servo.write(180)
Below example code
//Arduino Uno or Nano
Servo myservo;
void setup() {
Serial.begin(9600);
myservo.attach(7);
}
void loop() {
myservo.write(0);
Serial.println("Servo 0:");
delay(2000);
myservo.write(180);
Serial.println("Servo 180:");
delay(2000);
}
============================
NodeMCU like Lolin NodeMCU ESP32 and Servo Motor
Servo Motor 180 degree only turn 90 degree
Servo not start from 0 degree, but start 45 Deg angle
You can fix the servo 180 deg, only turn 90 deg. Add below command.
myservo.attach(14, 500, 2400) work on Tower Pro MG995 180 degree.
Other model may different range
Easy to fix, modify command inside Attach() to be
//NodeMCU Lolin ESP32 ESP8266
Servo myservo;
void setup() {
//myservo.attach(14);
myservo.attach(14, 500, 2400); // Change this code for ESP8266 Arduino board
}
void loop() {
myservo.write(0);
delay(3000);
myservo.write(180);
delay(5000);
}
============================
//Test for slow motion servo motor, can add Command delay
delay(15) slow
delay(1000) 1 second
3 сен 2022