question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pixel buffer accepts tuples but returns lists with different value

See original GitHub issue

On version 4.1.0

color values passed as tuples (r,g,b) are returned as `[brightnessr,brightnessb,brightness*c]

import board
import neopixel	
color_red=(80,0,0)		
self.pixels = neopixel.NeoPixel(board.D18, 256, auto_write=False, brightness=0.5)
red = (80,0,0)
pixels[1] = red
print( pixels[1])

Prints [40,0,0]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kattnicommented, May 4, 2020

This issue is resolved.

>>> import board
>>> import neopixel
>>> pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=False, brightness=0.5)
>>> red = (80, 0, 0)
>>> pixels[1] = red
>>> print(pixels[1])
(80, 0, 0)
0reactions
caternusoncommented, Jan 27, 2020

I think you might be hitting this: https://github.com/adafruit/Adafruit_CircuitPython_Pypixelbuf/pull/4#discussion_r368309515 which should be fixed in latest release. Try updating to the 5.0.0 release and see if the problem persists: https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/releases/tag/5.0.0 Return may still be a list, but hopefully will not have the incorrect value.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Return Multiple Values – How to Return a Tuple, List ...
In this article, we'll explore how to return multiple values from these data structures: tuples, lists, and dictionaries.
Read more >
How to generate a list of all (x, y, pixel value) tuples from a 2D ...
Shoot it is very close to that. I'm a stack overflow rookie. I'm subtracting two images and then fitting a 3D curve to...
Read more >
Map — gammapy v0.7
Interpolate map values at the given pixel coordinates. iter_by_coord ([buffersize]), Iterate over elements of the map returning a tuple with values and map ......
Read more >
image — machine vision — MicroPython 1.19 documentation
Returns a converted binary value (0-1) to a 3 value LAB tuple. L goes between 0 and 100 and A/B go from -128...
Read more >
pygame.Surface — pygame v2.1.4 documentation
pixel buffer address ... The Surface has a fixed resolution and pixel format. ... Per pixel alphas are different because they store a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found