LucidVR / lucidgloves

Arduino/ESP32 based DIY VR Haptic gloves. Compatible with SteamVR via OpenGloves.
MIT License
2.02k stars 259 forks source link

10 bit analog resolution #77

Closed shalomberm closed 2 years ago

shalomberm commented 2 years ago

Why do we have different analog resolutions on the esp and nano? It would be simpler to just set them both to 10 bits with analogReadResolution(10); in setup

hardlite commented 2 years ago

The question is why would you? It's set with an ifdef macro, so I don't see the point in reducing the ESP32's analog resolution, to save three lines of code.

LittleNyanCat commented 2 years ago

Throwing away those two bits lowers the ESP's resolution by a whopping 75%... ..and there's really not a good reason to do that.

shalomberm commented 2 years ago

There is a difference between resolution and accuracy. Unfortunately the ADC is not very accurate on the esp32 in any case. The benefit is that it makes it standard and the user doesn't have to set it in the UI, which admittedly aren't really big deals, but its very trivial to implement so I thought it was worth a shot

hardlite commented 2 years ago

The user.. doesn't have to set it. The compiler sets it according to the board type. It add zero complexity for the end user and negligible additional complexity to the codebase

LittleNyanCat commented 2 years ago

The UI/Driver is designed to be used with other firmwares and softwares other than lucidgloves, that max analog option is unlikely to go away for the foreseeable future.

shalomberm commented 2 years ago

Oh ok. Makes sense