# controlP5 Slider and Buttons as arrays

**URL:** <https://discourse.processing.org/t/controlp5-slider-and-buttons-as-arrays/39405>\
**Category:** Libraries\
**Created:** [October 23, 2022, 9:45pm UTC](https://discourse.processing.org/t/controlp5-slider-and-buttons-as-arrays/39405 "2022-10-23T21:45:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [October 23, 2022, 11:24pm UTC](https://discourse.processing.org/t/controlp5-slider-and-buttons-as-arrays/39405/2 "2022-10-23T23:24:19Z")

</div>

There is another recent post by Darthbray that might be worth your while:

> [@I can't figure out how to make this array compatible with my Button class](https://discourse.processing.org/t/i-cant-figure-out-how-to-make-this-array-compatible-with-my-button-class/39403):
>
> please format code with \</\> button \* [homework policy](https://discourse.processing.org/faq/#homework) \* [asking questions](https://discourse.processing.org/t/2147) I’m trying to create a randomly generated chord progression program but I haven’t even reached that part yet, I’m stuck on making an array with my button class. The error message is “Type mismatch: cannot convert from sketch\_221023a.Button to int,” which doesn’t make sense because I’ve followed 3 tutorials on how to implement arrays into classes and I don’t see what’s wrong. (please excuse some redundancies and messy att…

Rather than using a library such as controlP5, Darthbray wrote his/her own `Button` class. An array is made to hold 50 of these, which are created (and added to the array) a little bit later.

Similar to Darthbray’s `Button` class, you could write your own `SliderSet` class that groups together a slider and its associated buttons.

---

_[View the full topic](https://discourse.processing.org/t/controlp5-slider-and-buttons-as-arrays/39405)._
