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

Update Python API to control up to 256 LED #51

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

Conversation

areid-van
Copy link

Exposes two new features in the firmware:

  1. Can send data to up to 128 LED (384 bytes) using report 10
  2. Can use the 12 bit color mode to double the number of LED that can be controlled for report types 6-10.

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.


def _usb_get_string(self, device, index):
def _usb_get_string(self, device, length, index):
Copy link
Author

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
Copy link
Author

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:
Copy link
Author

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

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.

1 participant