Connecting two servos to one button

For a project I have to program a little two-wheel robot to move 3 feet then move around a pencil without touching the pencil, then have it come back to its original spot. Is there any way to connect two servos that at times run the same command then a separate command later on to one push button. The button will be used to start the program it will run the program return to its spot then stop.

Yes.

Please use established ways to describe the flow of the code. It's not home brew words.

1 Like
  • Why ? :thinking:

  • Always show us your schematic as you perceive it should be.

  • What hardware do you have ?

  • Show us your the sketch that you have written so far ?

1 Like

code it in sequential execution order, usage of 'wait' style elements should be relative to the previous code (i.e. 'repeat move forward until [obstacle detected], stor distance traveled value in [y]' -> 'if pencill detected: turn right 90 degrees' -> 'move [x] feet forward -> 'turn 90 degrees right, move forward [x] feet, turn right 90 degrees right, move [x] feet forward' -> 'turn 90 degrees left' -> 'move [y] forward' 'turn 180 degrees either direction')

if possible, set the code so that one input is used to close two outputs like in this sketch:
---switch on positive line------<= both outputs one top one bottom.
im new to ardurino but from a code and hardwireing perspective this is my best attempt at a solution. if this is too in-depth or confusing, just wire the motors in paralell relative to the switch, with a bit of code to control the speeds of each individual motor for turning, moving, etc.

and remember, a chain is only as strong as its weakest link. stay safe, good luck!

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