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

"Missing 2 required positional arguments: 'green' and 'blue'" #57

Open
Leeonardoo opened this issue Dec 31, 2018 · 1 comment
Open

"Missing 2 required positional arguments: 'green' and 'blue'" #57

Leeonardoo opened this issue Dec 31, 2018 · 1 comment

Comments

@Leeonardoo
Copy link

I'm trying to use this program in my RaspberryPi.
The file devices.py was getting a error about the name neopixel that hasn't been defined, so I was able to "fix" it by adding:
import neopixel
after the line:
for i in range(n_pixels):

But now it is giving everytime this error when I do "sudo python3 main.py"

main.py:929: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
y = np.fromstring(self.stream.read(self.frames_per_buffer, exception_on_overflow=False), dtype=np.int16)
Traceback (most recent call last):
File "main.py", line 2319, in
microphone.startStream()
File "main.py", line 931, in startStream
self.callback_func(y)
File "main.py", line 2237, in microphone_update
board_manager.boards[board].show(outputs[board])
File "/home/pi/Systematic-LEDs/python/lib/devices.py", line 370, in show
self.strip.setPixelColor(i, neopixel.Color(rgb))
TypeError: Color() missing 2 required positional arguments: 'green' and 'blue'

@lpearl
Copy link

lpearl commented Jan 27, 2019

Try changing in devices.py
self.strip.setPixelColor(i, neopixel.Color(rgb[i]))
to
self.strip._led_data[i] = int(rgb[i])

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

No branches or pull requests

2 participants