Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Since I have prior experience with programming an Arduino, as well as experience with servo motors, I decided to use both in my mechanism. I did not take into account the fact that servo motors can only rotate between 0 and 180 degrees when designing my mechanism. I wrote the code so that my servo motor would rotate 180 degrees from 90 degrees to -90 degrees. This had little effect on the motion for my mechanism but the slider's hole that I created was a bit longer than needed, due to the limited motion. Figure 1 shows the connection used to power my motor, while Figure 2 shows the code to control the motor's rotation.


Image Added

Figure 1. Servo Motor and Arduino Connection


Image Added

Figure 2. Motor Control Code