-
Notifications
You must be signed in to change notification settings - Fork 53
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
Update Python API to control up to 256 LED #51
base: master
Are you sure you want to change the base?
Conversation
Allows ATTiny85 to address twice as many LED with its limited memory
|
||
def _usb_get_string(self, device, index): | ||
def _usb_get_string(self, device, length, index): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My USB library seemed to require a length parameter which required a lot of changes like this. Not sure if this is appropriate for master. I could revert.
@@ -432,6 +434,9 @@ def _determine_report_id(self, led_count): | |||
elif led_count <= 64 * 3: | |||
max_leds = 64 | |||
report_id = 9 | |||
elif led_count <= 128 * 3: | |||
max_leds = 128 | |||
report_id = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add support for report 10 here
report.append(data[i]) | ||
else: | ||
report.append(0) | ||
if self.mode == 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pack the data so each 24 bit RGB tuple is two interleaved 12 bit RGB tuples for mode 3
Exposes two new features in the firmware:
Using both features together you can control up to 256 LED. 12 bits still gives a pretty nice range of colors.
Sorry there are a bunch of trivial changes included to work with a different version of the USB library on my system. Those might need to be reverted.