Hello everyone,
We have been experimenting with the Arduino for a few months now and was wondering if you could explain this "phenomenon".
We're trying out servo control without the Servo library, ie. using the PWM directly to the pins.
The common example already seen in many places is;
int servopin = 11;
int pulse = 1500;
void setup()
{
pinMode(servopin,OUTPUT);
}
void loop()
{
digitalWrite(servopin,HIGH);
delayMicroseconds(pulse);
digitalWrite(servopin,LOW);
delay(20);
}
However, having discovered analogWrite(), we replaced the loop() section with;
analogWrite(servopin, 127); // min-max = 0-255
delay(500); // wait for half second ??
Our question is, how come the latter leaves the servo jittery ? It also gets rather hot pretty quickly.
What are the underlying circumstances that make the digitalWrite() and analogWrite() scenarios different ?
Thanks!