Servo debug Sketch

If you don´t like this forum feel free to use another one.

Creatures of habit, sure. But that doesn’t give anyone the right to be disrespectful or dismissive, especially on a forum intended for learning. It’s ignorant to think that this kind of behavior is acceptable. Based on your response, it seems you do. Grown adults, right?

it´s not about accept responses it´s more about people who like to pride themselves by posting their stuff and be pissed if others find this stuff improvable.

Your response is not relevant to the issue being discussed. You’re addressing a different situation entirely. A user being upset over positive feedback is one thing, but a user being upset because they’re being bullied by the community is the real issue here. In fact, your aggressive tone only reinforces my point. This kind of behavior is driven by ego and is exactly what’s wrong with the Arduino forum.

If the servo is commanded to move 90 degrees, does it actually move 90 degrees? Have you checked it with a square or angle finder? I've written a simple sketch to find the servos actual endpoints and centerpoint if you are interested.

Yea I am interested always, I normally setup the servo to 90 degrees and then adjust the physical component to match the 90 degree angle of the program.

meach1 thank you for your contribution. I try to contribute very positively on subjects where I think I can help. It's not hard, I just imagine the kind of help I would like to receive while I'm writing. Otherwise, why help at all?

I do a lot of reading for tidbits of information that will help with my projects and try to ignore the negativity. I have an on again and off again relationship with this forum because of the negative tone.

Right now I'm on again and observing the dynamics. I may log out again soon. It's a shame the tone can't mature over time; as experienced members get older I expect there should be some increase in maturity and patience. If that's happening I'm having a hard time detecting it.

Print out the protractor picture below (may have to adjust for size) on stiff "picture paper", you can paste it under a servo horn for degree reference.
Here's the sketch. Can I PM you with instructions (how I do it)?



#include <Servo.h>
Servo servo;
int
  zeroVal = 500,
  maxVal = 2480,
  centerVal = (maxVal - zeroVal) / 2 + zeroVal; 
  
byte cntr = 0;

void setup() 
{ 
  Serial.begin(9600); // set serial monitor line ending to Newline
  servo.write(centerVal);
  servo.attach(9,zeroVal,maxVal);
  Serial.println(F("degrees      microseconds"));
  printIt();
}
void loop() 
{
  // if there's any serial available, read it:
  while (Serial.available() > 0)
  {
    // look for the next valid integer in the incoming serial stream:
    int pos = Serial.parseInt(); 
    // look for the newline. That's the end of your sentence:
    if (Serial.read() == '\n') {} // skip 1 second wait
    servo.write(pos);
    if(++cntr >= 8) // print header
    {
      Serial.println(F("degrees      microseconds"));
      cntr = 0;
    }
    printIt(); 
  }    
}    
void printIt()
{     
  Serial.print(servo.read());Serial.print("\t\t");
  Serial.println(servo.readMicroseconds());
}