So I'm trying to get a blinkstick flex (LED controller) to work with some scripts from github.
Keep getting the same errors on all scripts
I have very little experience with python/programming so any help would be appreciated.
>>245138
I have no idea what you are trying to do but the error means that self.reports does not have a wValue - 1th element.
Perhaps print(self.reports) and then compare that to the expected list.
>>245138
The errors preceding the bottom one are being caused by _usb_control_transfer trying to return a an invalid index.
>>245138
You're calling the API right, so the problem is somewhere else.
I suspect you've got to install libUSB or a device driver for the thingy (or maybe be running as elevated administrator), because Windows just letting random Python scripts send raw USB packets to random devices would undermine the security model (for instance a script running as another user could talk to the USB keyboard while you're using it).
There's example python scripts that come with the blinkstick library; see if they work.
>>245156
How about you print self.reports before the line in green and check that there is a 0x81 - 1th element.
>>245156
OP says he has little experience, so it helps to make him understand what everything is in the first place.
>>245158
I suspect you do too, because you're asking someone who just picked up Python to debug someone else's library.
You realise every single line of code in that screenshot is library code, right?
>>245168
Add the line `print(self.reports)` before the line that causes the error.
Paste the output here.
>>245168
What if you find an example and copy/paste it into your project?
Your code simply isn't doing enough for there to be an error in it: it's the same boilerplate as in all the rest of the examples, and it's obviously calling the library because we can see the library throwing up.
>>245170
Like so?
>>245174
No, put it in the library code, above `return(self.reports[wValue - 1].get())`
>>245176
Didn't seem to do anything
>>245181
What exactly are you trying to make with your script?
>>245183
That kinda makes sense.
Pic works no problem
>>245184
I downloaded a repository of effects for the blinkstick flex. Each one has the same error, so I am trying to find what the problem is on the most simple script
>>245189
At the very least, you can just manually use 32 (according to their website) for your LED count.
>>245195
Thanks that works. Still gonna try to find out whats wrong with the get_led_count though.