adafruit / Adafruit_Wippersnapper_Arduino

WipperSnapper is a firmware for creating no-code IoT electronics projects.
https://io.adafruit.com/welcome
MIT License
27 stars 40 forks source link

Change AnalogIO DEFAULT_HYSTERESIS to 0.02 #555

Closed tyeth closed 3 months ago

tyeth commented 3 months ago

Was experiencing some lower than expected resolution with the analog potentiometer, S3 TFT Feather. Double checked the code and it's good as far as resolution etc goes. Noticed the value for hysteresis was 0.2 and labelled 2%. The calculation in the update check is (_analog_input_pins[i].prvPinVal * DEFAULT_HYSTERISIS);

I'm running a build with #define DEFAULT_HYSTERISIS 0.02 ///< Default DEFAULT_HYSTERISIS of 2%

tyeth commented 3 months ago

Retested and this works well. As an example at 20000 out of 32k it now changes after +/-400, rather than 4000! Before it felt sluggish/insensitive when the potentiometer was minutely adjusted or slowly turned.