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

Mismatch between legacy constants and setMode() #6

Open
cmcconomy opened this issue Jan 19, 2017 · 1 comment
Open

Mismatch between legacy constants and setMode() #6

cmcconomy opened this issue Jan 19, 2017 · 1 comment

Comments

@cmcconomy
Copy link
Contributor

in the pid code, the following are defined:

// Constants for backward compatibility
PID.AUTOMATIC = 1;
PID.MANUAL = 0;

I assumed these were to be passed to setMode() - I prefer explicit constants to "magic strings".

However, in setMode(), instead of values 0 and 1, setMode() refers to 1 and 2:

    if (Mode == 1 || Mode.toString().toLowerCase() == 'automatic' || Mode.toString().toLowerCase() == 'auto') {
        newAuto = 1;
    }
    else if (Mode == 2 || Mode.toString().toLowerCase() == 'manual') {
        newAuto = 0;
    }

Shouldn't these correspond?

@wilberforce
Copy link
Owner

Yes - it looks like it might be related to this update:

9f62aa5

Do you want to update and do a pull request?

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