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

Strange switch in _shortCycleProtection #3

Open
alexisfradel opened this issue Nov 24, 2015 · 1 comment
Open

Strange switch in _shortCycleProtection #3

alexisfradel opened this issue Nov 24, 2015 · 1 comment

Comments

@alexisfradel
Copy link

Hello,

I've just checked your code and it looks really interesting.
Unfortunately I'm new to Arduino and so I would like to check if I've understood correctly the code.

In the function _shortCycleProtection, why do you use a switch statement since it seems that you do exactly the same thing in both scenarii?

Thanks for the clarification.
Alexis

@bbustin
Copy link
Owner

bbustin commented Dec 9, 2015

Hi Alexis,

I did a double-take when looking at the code. At first I thought it was exactly the same in both cases as well and that the switch statement was an error. Then I looked again and saw why it was there.

If the system is currently running, it makes sure the system stays on for at least minRunTimeMillis. This ensures the system does not only come on for a short period of time and then turn off. If the system is not running, then it makes sure the system has been off for at least minOffTimeMillis. This protects the AC compressor from being damaged by making sure it has been off for long enough before we allow it to come back on.

  • Brian

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