# SN\_PHOTORESISTOR usermod analog input configurable pin

**URL:** <https://wled.discourse.group/t/sn-photoresistor-usermod-analog-input-configurable-pin/11425>\
**Category:** Enhancements\
**Created:** [March 23, 2024, 11:47am UTC](https://wled.discourse.group/t/sn-photoresistor-usermod-analog-input-configurable-pin/11425 "2024-03-23T11:47:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![XKVMOTO](https://avatars.discourse-cdn.com/v4/letter/x/90db22/32.png) [@XKVMOTO](https://wled.discourse.group/u/XKVMOTO)\
**Post date:** [March 23, 2024, 11:47am UTC](https://wled.discourse.group/t/sn-photoresistor-usermod-analog-input-configurable-pin/11425/1 "2024-03-23T11:47:33Z")

</div>

The SN\_PHOTORESISTOR usermod has fixed the Analog pin to use:

in \<usermod\_sn\_photorsistor.h\> you find this line:

#define PHOTORESISTOR\_PIN A0

Why not make it configurable at compilation time? , for instance:

#ifndef PHOTORESISTOR\_PIN  
#define PHOTORESISTOR\_PIN A0  
#endif

so we can define any other analog input at environment definition level in platformio.ini; for instance:

-D PHOTORESISTOR\_PIN=33 ; Pin A5 - ADC1\_CH05 =\> if not defined default value = A0 (36)

Or even enable the configuration at user interface level…

while in ES8266 you can only use A0; in ESP32 you have more options, all de ADC1 pins.

---

<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:** [March 23, 2024, 12:34pm UTC](https://wled.discourse.group/t/sn-photoresistor-usermod-analog-input-configurable-pin/11425/2 "2024-03-23T12:34:24Z")

</div>

You are welcome to update source, verify that it is working and submit a PR.
