The sample code for the Prop Maker 3 Watt LED (link below) does not seem to work. I get an error on the line r, g, b = colorwheel(i):
TypeError: 'int' object is not iterable
It seems that colorwheel just returns an integer
Using circuitpython 7.1.1 on an M4 Express
Any suggestions?
Sample code is here (scroll down to the 3 Watt LED example):
https://learn.adafruit.com/adafruit-pro ... cuitpython
Prop Maker 3WATT LED
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15831
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Prop Maker 3WATT LED
Yes, colorwheel in rainbowio currently returns an int: 0xRRGGBB. You'll have to tear it apart to extract each byte:
Instead of
you can use
Dave
Instead of
Code: Select all
r, g, b = colorwheel(i)
Code: Select all
c = colorwheel(i)
r = (c >> 16) & 0xFF
g = (c >> 8) & 0xfFF
b = c & 0xFF
- dcaditz
- Posts: 2
- Joined: Tue Dec 21, 2021 1:40 am
Re: Prop Maker 3WATT LED
Thank you. That explains it. I think there is a typo in the g line, though.
- dastels
- Posts: 15831
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Prop Maker 3WATT LED
Ah, yes I didn't backspace over that lowercase f. Good catch.
Dave
Dave
Please be positive and constructive with your questions and comments.