# How to Define Button GPIO & Type in PlatformIO\_Override.ini

**URL:** <https://wled.discourse.group/t/how-to-define-button-gpio-type-in-platformio-override-ini/9099>\
**Category:** Questions\
**Created:** [August 30, 2023, 4:44am UTC](https://wled.discourse.group/t/how-to-define-button-gpio-type-in-platformio-override-ini/9099 "2023-08-30T04:44:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![markabyrd](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/markabyrd/32/3916_2.png) [@markabyrd](https://wled.discourse.group/u/markabyrd)\
**Post date:** [August 30, 2023, 4:44am UTC](https://wled.discourse.group/t/how-to-define-button-gpio-type-in-platformio-override-ini/9099/1 "2023-08-30T04:44:08Z")

</div>

HOW TO DEFINE BUTTON GPIO & TYPE

Reading a June 22 [Reply](https://wled.discourse.group/t/define-default-pins-for-multi-outputs/5499/4) to another Question, I find I can define (and comment) default LED pins in PlatformIO\_Override.ini like this…

-D DATA\_PINS=16,17,21,22 ;ESP32 GPIO for RGBIC Strips  
-D PIXEL\_COUNTS=28,28,28,28 ;LED count per strip  
-D DEFAULT\_LED\_COUNT=112 ;?? Redundant?

HOW DO I DEFINE BUTTIONS???

Like this?

-D BTNPIN=15,26,36 ;ESP32 GPIO for Buttons 0,1,2  
-D buttonType=Push,Push,Push ;Button Type  
-D WLED\_MAX\_BUTTONS=3 ;?? Redundant?

---

<div class="post-metadata">

**Author:** ![divsys](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@divsys](https://wled.discourse.group/u/divsys)\
**Post date:** [August 30, 2023, 2:03pm UTC](https://wled.discourse.group/t/how-to-define-button-gpio-type-in-platformio-override-ini/9099/2 "2023-08-30T14:03:39Z")

</div>

I’m no expert in the code (not even close), but I don’t think there is a standardized default action for buttons.

If you explore through the usermods, you may get some ideas on what has been done so far, but this is still WIP territory.

I’ve noticed the MoonModule fork has a rather in depth discussion of the code in various places.  
Take a look through the [MM KB](https://mm.kno.wled.ge/advanced/buildflags/) to get some good examples of how things are structured.

Those with more intimate knowledge of the code may feel free to stomp over all my comments as they see fit…

---

<div class="post-metadata">

**Author:** ![Jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@Jinx](https://wled.discourse.group/u/Jinx)\
**Post date:** [August 30, 2023, 4:46pm UTC](https://wled.discourse.group/t/how-to-define-button-gpio-type-in-platformio-override-ini/9099/3 "2023-08-30T16:46:10Z")

</div>

You might have luck using this and having a look at the code it generates. Maybe something in it will help. I dunno…

[https://wled-compile.github.io/](https://wled-compile.github.io/)

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [August 31, 2023, 5:52am UTC](https://wled.discourse.group/t/how-to-define-button-gpio-type-in-platformio-override-ini/9099/4 "2023-08-31T05:52:30Z")

</div>

Short answer: You can’t.  
There is no provisioning for buttons.
