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

pwmWrite doesn't allow values > 14 bits on pin numbers < 16 #152

Open
soundanalogous opened this issue Feb 26, 2017 · 4 comments
Open

pwmWrite doesn't allow values > 14 bits on pin numbers < 16 #152

soundanalogous opened this issue Feb 26, 2017 · 4 comments
Assignees

Comments

@soundanalogous
Copy link
Member

For future proofing, we should allow pwm/analog writes of values > 14 bits on pins 0 - 15. Currently higher res writes are only available for pins > 15:

https://github.com/firmata/firmata.js/blob/master/lib/firmata.js#L776-L806

@rwaldron
Copy link
Collaborator

I'm certainly all for future proofing—do you have an idea of how we might accomplish this?

@rwaldron
Copy link
Collaborator

I wonder if we could just switch to using EXTENDED_ANALOG for all pins? (I haven't actually looked to see if that's doable)

@soundanalogous
Copy link
Member Author

Switching to EXTENDED_ANALOG is one option. Another is changing line 781 to:

if (pin > 15 || value >= 0x00040000 - 1) {

@soundanalogous
Copy link
Member Author

correction (no need for the -1)

if (pin > 15 || value >= 0x00040000) {

@soundanalogous soundanalogous self-assigned this Jul 8, 2017
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