Servo motors not moving

The servo does not report back to the sketch it’s position.

You need to keep tack, in your sketch variable, the last position you told the servo to go to.

When you tell the servo to go to a certain position, do your Serial.println( ) with that position.



Did the sketch in post #17 move your servo(s) back and forth ?

We assume you installed the Adafruit library using the IDE .

The Sketch in #17 worked, but I had to put the arm on the servo shaft to see the movement. Thanks now I have something I can work with. Same code my railroad guy used to test his servos. How do I speed up the movement?

There are a few delay(500); in the sketch
try

delay(100);

Also play with

  for (uint16_t pulselen = SERVOMIN; pulselen < SERVOMAX; pulselen++) {
    pwm.setPWM(servonum, 0, pulselen);
  }

Yes, I installed the library. I'm not exactly code dead, I just rather not do it. :)))) Getting this far led to some lessons, like if you have multiple sketches in a folder the compiler will attempt to compile them all together when you load one leading to error exits. I learned I can use the digital pins as switch inputs and LED outputs. The MEGA has plenty to handle both. I was hung up for a while on the analog pins trying to figure out how to use 16 switches on a single analog pin, and I was going to use a second PCA at 0x41 for the 16 LED pairs. Then I was going to give up. :)))))

I have the parts for a test jig, and with this working code I can build the jig and upload the final Ladyada :heart_eyes: :))))) ino that adds buttons and LEDs.

I got so excited at being able to move forward after days of frustration I forgot to say thanks. THANKS! My codephobia is so bad that I watched all three of Ladyada's videos, even downloaded the text versions and was just as ignorant as I was before I saw them. :)))))) I even took courses in UNIX, and C. I was even planning at one point to get a degree in Software Engineering. The stuff just did not compute in my brain. Some people are able to think in the language they use whether it be a software one or a verbal one. I on the other hand have to translate it in to English in order to understand it. However when it comes to hardware, I'm a whisperer :)))))) It literally talks to me, that's why I became a hardware test engineer. :computer: I don't play sports well either :)))))) I can build a computer from parts, but I can't dribble a basketball. :))))))