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

PWM wrapper for hardware or software PWM #92

Open
michaeljanich opened this issue Mar 23, 2018 · 0 comments
Open

PWM wrapper for hardware or software PWM #92

michaeljanich opened this issue Mar 23, 2018 · 0 comments

Comments

@michaeljanich
Copy link

My code is full of

    if (pin == 1 || pin == 23) {
	wpi.pinMode(pin, wpi.PWM_OUTPUT); // hardware PWM
	wpi.digitalWrite(pin, value);
    } else {
	wpi.softPwmCreate(pin, 0, value / 10.23);
    }

these if's to distinguish between software PWM and hardware PWM pins.

Is there a better solution? Like an automatic switch inside the library?

THANKS

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

1 participant