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

DotStar LED's #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

DotStar LED's #122

wants to merge 2 commits into from

Conversation

segfault16
Copy link
Owner

This PR resolves #121.

Server and Demo can now be started with -D DotStar for DotStar LED device.

@maxycatz
Copy link

I am a total novice with Python; although apa102 is installed, I could only get the apa102 module to load by copying tinue's 'driver' and 'colorschemes' folders into modular-led-workstation-master folder then calling 'from driver import apa102'.

Have'nt got further than this atm, 'cause audio playing up and need to sort.

Comment on lines +176 to +179
elif self.getConfiguration(CONFIG_DEVICE) == devices.DotStar.__name__:
device = devices.DotStar(
self.getConfiguration(CONFIG_NUM_PIXELS), self.getConfiguration(CONFIG_NUM_ROWS),
self.getConfiguration(CONFIG_DEVICE_CANDY_SERVER))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates DRY. I suggest using getattr to instantiante the class dynamically.

   def createOutputDevice(self):
            device = getattr(devices, self.getConfiguration(CONFIG_DEVICE))(
                self.getConfiguration(CONFIG_NUM_PIXELS), self.getConfiguration(CONFIG_NUM_ROWS))

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.

Running With DotStar-apa102c
3 participants