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

IoPin should have a pwmWrite() method #76

Closed
Wallacoloo opened this issue Jan 16, 2015 · 0 comments
Closed

IoPin should have a pwmWrite() method #76

Wallacoloo opened this issue Jan 16, 2015 · 0 comments

Comments

@Wallacoloo
Copy link
Owner

Right now, digital writes are implemented via IoPin.digitalWrite(), but setting a pin's PWM value is done by making a call to the HardwareScheduler.queuePwm(). This makes sense, because hardware PWM is not always possible. But it makes it necessary to pass a reference to the HardwareScheduler to any function that might need to use PWM, which is both impractical and awkward.

So, it would make more sense to implement IoPin.pwmWrite() and have it relay to PrimitiveIoPin.pwmWrite(), which can either implement it directly, or the developer can give their platform's HardwareScheduler a static method for scheduling pwm & use that.

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

No branches or pull requests

1 participant