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

store configuration response resolution value #105

Closed
soundanalogous opened this issue Jan 5, 2016 · 10 comments
Closed

store configuration response resolution value #105

soundanalogous opened this issue Jan 5, 2016 · 10 comments
Assignees

Comments

@soundanalogous
Copy link
Member

It appears that the only the pin modes are recorded from the configuration query response. The resolution value should also be stored because it contains info such as the resolution of the analog input and output pins (PWM and also soon to be added DAC) as well as pin mapping for Serial pins (which pins correspond to which UART) and I2C mapping (SDA pin vs SCL pin).

@soundanalogous soundanalogous self-assigned this Jan 5, 2016
@rwaldron
Copy link
Collaborator

rwaldron commented Jan 5, 2016

👍

@dtex
Copy link
Contributor

dtex commented Nov 26, 2016

Just a note to say that we have a real user with a problem that could be solved by this. The user is running a Feather Huzzah (10-bit PWM) and is trying to drive a motor (via an h-bridge). J5 sends 255 because it doesn't know the pin capability of the Huzzah.

@ghtomcat
Copy link

That user is me ... the motor driver is a DRV8833 from Adafruit

@ghtomcat
Copy link

I'm using setPin and setPWM directly as a workaround in the meantime

@soundanalogous
Copy link
Member Author

StandardFirmata already reports a 10-bit resolution for the ESP8266 boards so this simply needs to be defined in firmata.js. There are different resolutions for any give pin depending on which mode it's in. The pin object in firmata.js could use a pwmResolution property and an adcResolution property and then those would be set when the capability query returns.

@rwaldron
Copy link
Collaborator

The pin object in firmata.js could use a pwmResolution property and an adcResolution property and then those would be set when the capability query returns.

+1

@soundanalogous
Copy link
Member Author

I will try to find time to add these properties this weekend.

@monteslu
Copy link
Contributor

monteslu commented Dec 2, 2016

Any reason we wouldn't want to keep all the resolutions in a map per mode as opposed to just the 2 properties? Doesn't matter for digital IO, but we still have SERVO, STEPPER, and SERIAL.

Might be just a corner case for me with remote-io, but kinda feels like we should just keep all the resolution data since we're marshaling it with CAPABILITY_RESPONSE anyway.

Maybe something instead of pin.adcResolution we do pin.resolutions[board.MODES.ANALOG]

@soundanalogous
Copy link
Member Author

We should definitely store all of them. I was just citing those two as an example.

@soundanalogous
Copy link
Member Author

soundanalogous commented Dec 2, 2016

pin.adcResolution is much simpler to use than pin.resolutions[board.MODES.ANALOG]

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

5 participants