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

fix uninitialized value, fix unsigned calculation #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nekowokaburu
Copy link

Thanks for the lib! I noticed that the Relay version has some bugs:

  • _lastPulseTime was uninitialized, I set it to millis() to catch up quicker
  • the _lastPulseTime computation in the while loop can go wrong on two unsigned values, especially with one uninitialized ;)

I also moved the millis() check out of the loop as I'd rather have a more robust PID that can always catch up to the millis() value in the while loop than the small speed improvement, if any. I am running an espresso machine with this and would hate to see it blow up ;)

ademuri added a commit to ademuri/AutoPID that referenced this pull request Oct 22, 2022
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

Successfully merging this pull request may close these issues.

1 participant