Redefine button_pin on tbeam 1.0

I’m planning to connect an external button-pin on a tbeam v1.0
Normally the middle button is on gpio 38 of the ESP32, this pin is not connected to any of the header pins of the board.
So I was thinking to use pin 2 and change in variant.h of the tbeam the line
#define BUTTON_PIN 38 // The middle button GPIO on the T-Beam’ into
#define BUTTON_PIN 2 // The external button on the T-Beam’

Would pin 2 be a good choice ?

my experience :
I tried to make pin 2 the external middle-button pin.
This did not work very well.
In wifi tbeam will not connect to my local wifi (which it did with pin38 button)
Instead it boots up as software AP on 192.168.42.1 even if wifi_ap_mode is false.

So i tried pin 13 and didn’t change anything in the source.
It just seems that the line

#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented anywhere.’

solved the troubles and a external button between GND and gpio_13 works as intended without any software changes.

b.t.w. i was using version 1.2.53

edit:
I actually changed something in the variant.h for tbeam device
removed the comment sign ‘//’ before #define BUTTON_PIN_ALT 13
and commented out with ‘//’ before #define EXT_NOTIFY_OUT 13

so pin 13 is not an input and output at the same time.

This is how my t-beam with a big red external button and a 2.42 inch oled looks compared to a regular heltec 2.1 with 0.96 inch oled.

Everyone can read the info easy from a distance.

1 Like