Servo control with while

good evening everyone, I want to ask you guys. I have
2 servo motors I want to control the servo to stop in one rotation and after that switch again to the second servo and it will return to its original position at the same time. I was asked to use the while, if and break commands. I use the adafruitPWMservodriver.h library can anyone help me, thanks in advance

this feels like a school project. What have you tried?

Your topic has been moved. Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.

I find your description a little difficult to follow. Can you write down the steps that your program has to do as points; e.g.

  1. Move servo one.
  2. Wait till move of servo one complete.
  3. Move servo to ...
  4. Other steps ...
  5. Back to step (1).

As you did not provide information about the components used in your project, it is almost impossible to help you.
I recommend you read the topic:

Then redo your topic by adding information such as:

Which microcontroller will be used;
Which servos will be used;
Power supplies that will be used;
Schematic of your project;

and using the tags as recommended in the text you will read, post your code, even if it doesn't work.
etc....

Oh, and the name of your teacher who requested this assignment.... :grin: :grin: :grin:

Servos with feedback (standard rc type) rotate only 180 degrees at best.

Yes this is my final projects, initially I had done it by using the delay command to stop the servo temporarily and the program continued for the next servo but I was asked again what if I used the while command, I had tried several while commands to stop one servo rotation and continue another rotation to the next servo but the command I use only stops the servo simultaneously and does not continue to the next servo rotation

Hint: We can't point out mistakes in code that we can't see.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.