Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation error which can easily be solved #8

Open
SinkroniusMaximus opened this issue Jul 5, 2022 · 1 comment
Open

Calculation error which can easily be solved #8

SinkroniusMaximus opened this issue Jul 5, 2022 · 1 comment

Comments

@SinkroniusMaximus
Copy link

SinkroniusMaximus commented Jul 5, 2022

afbeelding

Hello I found I small error in the calculation.
When ohms is smaller than rW_ohms, the result is unwanted, see image.
Using the example for rAW_ohms_max here which is 5090.
I also applied the scale to 100.0.

So in this example when you enter 1 percent, the potmeter wiper goes to P0A or P1A instead of P0B or P1B.

I would suggest a:

if(ohms < rW_ohms)
{
return 0;
}

works for me

P.S. I found this lib via PlatformIO, and it works on ESP32, all I needed to add was SPI.begin(); in the setup(), pins are standard sck=18, miso=19, mosi=23 and cs=5. Thanks for this and keep it up!

@dreamcat4
Copy link
Owner

hi there, I agree so if you ever want to submit either

a) a ,diff or .patch file. For example, make the working changes after doing git clone, then run the cmd git diff > filename.patch

or b) a quick simple pull request (PR) with those change in git then please go ahead, and it will be merged pre approved for this bug.

Would prefer the full code change since I am unable to check / verify myself. Wheras you can do this.
And many thanks for finding this.

BTW If you also want to include the changes for SPI library then sure, go ahead with that too. But it isn't really matter / can take it or leave it. Given that other embedded platforms exist, which might have just slightly different SPI library call (so it is therefore it's probably more difficult to universally please everybody on that aspect).

Good day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants