Is there a arduino #define alternative?

Hi,

I was wondering if there is an option for defining all the pins in one place and only using pin-aliases for the components later?

The functionality I’m searching:
When programming an Arduino you can write #define LCD_CS 27 and then you can use LCD_CS instead of writing 27.

Is there a way to do something like it in esphome? so fare I could not find anything.

thx for the answer but this does only work for strings :confused:

GPIO27 is a string.

1 Like