Skip to content

show_QR method call fails #30

Closed
Closed
@seantibor

Description

@seantibor

I'm trying to show a QR code on the screen when a touch is detected. Perhaps I'm doing something wrong?

Here's my code:

while True:
    p = ts.touch_point
    if p:
        print('{} was pressed'.format(p))
        light_on_time = time.monotonic()
        if not backlight:
            backlight = 1.0
            pyportal.set_backlight(1.0)
        elif p[1] < 240//3 * 2:
            current_image += 1
            if current_image == len(images):
                current_image = 0
            pyportal.set_background(cwd+images[current_image][0], images[current_image][1]) 
        else:
            pyportal.show_QR(b'http://bit.ly/2Y6zPu7')
    if backlight and (time.monotonic() - light_on_time) > backlight_timeout_seconds:
        backlight = False
        pyportal.set_backlight(0)

    time.sleep(0.05)

I am getting the following error message

Traceback (most recent call last):
  File "code.py", line 51, in <module>
  File "adafruit_pyportal.py", line 845, in show_QR
ValueError: pixel value requires too many bits

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions