# Objects in an array

**URL:** <https://forum.arduino.cc/t/objects-in-an-array/935241>\
**Category:** Programming\
**Created:** [December 13, 2021, 12:41am UTC](https://forum.arduino.cc/t/objects-in-an-array/935241 "2021-12-13T00:41:18Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![dolittle](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@dolittle](https://forum.arduino.cc/u/dolittle)\
**Post date:** [December 13, 2021, 3:10pm UTC](https://forum.arduino.cc/t/objects-in-an-array/935241/12 "2021-12-13T15:10:18Z")

</div>

When a switch button is HIGH it turns a servo to the zero position, when LOW it turns the servo to set position in this case 10.  
I can put most of the code in a for next loop with an array but am not sure how to do the button and servo objects.

[https://forum.arduino.cc/t/varspeedservo-a-modified-servo-library-with-speed-control/61404](https://forum.arduino.cc/t/varspeedservo-a-modified-servo-library-with-speed-control/61404)

This is the link I used to obtain VARSPEEDSERVO

Thank you for your help.

---

_[View the full topic](https://forum.arduino.cc/t/objects-in-an-array/935241)._
