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

[WIP] Prototype for DRYing out controller logic #876

Closed
wants to merge 1 commit into from

Conversation

scottgonzalez
Copy link
Contributor

This is just to get some discussion going for #762. I've done some initial work for PCA9685 in Led/Led.RGB. Once we agree on the approach to take, I can do some work more and then update the tests.

There are a few questions written as TODOs in the controller file.

@dtex
Copy link
Collaborator

dtex commented Jul 24, 2015

Me gusto mucho.

Do we have a list of other controllers?
How does this relate to expanders?
Does the PCA9685 ever accept anything besides 12-bit values? (this removes the ability to set PWM range)

@scottgonzalez
Copy link
Contributor Author

Do we have a list of other controllers?

I can put a list together by searching for "var Controllers". I think many of them are actually component-specific so this abstraction wouldn't need to be applied to them. I'll go through and see which ones are used by more than one component.

How does this relate to expanders?

At least based on the current design of Johnny-Five, users initialize the expanders themselves. This would only apply to the existing controller option within the individual components. Perhaps PCA9685 is just an odd case?

Does the PCA9685 ever accept anything besides 12-bit values? (this removes the ability to set PWM range)

The PWM range will be supported once I get to a controller that doesn't use the full range. I know at least servo uses a different range.

@rwaldron
Copy link
Owner

My plan was to use instances of Expander wherever possible; I have a bunch of work completed for migrating the PCA9685 (just that so far), but it's all in a git stash. I don't want another new PCA9685 thing.

@rwaldron
Copy link
Owner

Out of the stash, committed, rebased, etc... https://github.com/rwaldron/johnny-five/commits/controllers-can-use-expanders

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

Successfully merging this pull request may close these issues.

3 participants