Display Pack v2.8 with Pico 2 issues?

My Pico 2’s and Display Pack V2.8’s arrived today. It’s been somewhat of a comedy of errors, except I’m not laughing.
I have a custom demo file I run on my Display Pack v2’s. It’s the balls_demo.py with some code added to control the RGB LED color based on the Button pressed. Without this extra code added the RGBLED lights up a dim white almost yellow. This file would not work at all on a Pico 2 with Display Pack v2.8. One issue is the pins used for the RGB LED are different on the V2.8 versus V2 display pack. No mention of this on the product page. No schematic or pinout diagram for the v2.8 either. It is stated in the new example file, though. Which I finally stumbled upon.

I edited that bit of code but it still didn’t fix things as the Button function / module is broken for the Pico 2. Took me a while to figure out what was working and what wasn’t.

Display Pack V2.8 with Pico 2
pico2_rp2350-v0.0.5-pimoroni-micropython.uf2

new balls_demo.py
Works Ok once edited for DISPLAY_PICO_DISPLAY_2
LED was off

button_test.py
LED RGB set to led = RGBLED(26, 27, 28)
Regardless of this it just kept flashing Button A pressed and LED flashed white.


Display Pack V2.8 with Pico
pico-v1.23.0-1-pimoroni-micropython.uf2

new balls_demo.py
Works Ok once edited for DISPLAY_PICO_DISPLAY_2
LED was on ( a dim half on)
Adding the following turned the RGB LED off
from pimoroni import RGBLED
led = RGBLED(26, 27, 28)
led.set_rgb(0, 0, 0)

button_test.py
Works Ok once edited for DISPLAY_PICO_DISPLAY_2
And LEDRGB set to led = RGBLED(26, 27, 28)


Display Pack V2 with Pico 2
pico2_rp2350-v0.0.5-pimoroni-micropython.uf2

new balls_demo.py
Works Ok once edited for DISPLAY_PICO_DISPLAY_2
LED was off

button_test.py
LED RGB set to led = RGBLED(6, 7, 8)
button test did not work, just kept flashing Button A pressed and LED flashed white.

I agree there is something wrong with this combination and I suspect it is in the Pimoroni uf2 build. I gave up as I do not find it easy swapping components around on the Omnibus Expander. I got the balls bouncing around but the button test did not work. I reloaded the recommended MicroPython uf2 build on the Pico Plus 2 and my own simple button tests worked fine (print() only, no display).

I’m spoiled. I bought 2 of the new Display Packs and 3 Pico 2’s. The above is three separate test setups. For me, the Display Pack RGB LED being partially on is an annoyance. So I add code to turn it off.

I’m wondering if Button issue has anything to do with this?
RP2350: Internal pull down issue - Support - Pimoroni Buccaneers

You could be right. My code uses pull-up logic.

What I did not mention was that I managed to knock the USB-C socket off my reference Pico Lipo. It has pushed back into place and seems to work ok, but even so… So it had been a long day, I was tired and now annoyed. My USB-C plugs have long bodies which means more leverage if I accidentally catch one while faffing about with Omnibus expanders. My fault.

I only bought 2 Pico Plus’s but I also have the Plasma 2350 - perfect for a specific project I am working on - and the Tiny 2350 which looks ridiculous hanging off the end of a USB cable. The plan for that is to build a tiny controller for DC motors. A MOSFET H-bridge controller is not much bigger than the Tiny.

Tired and annoyed would be a good description of how I felt end of day yesterday.

On the plus side I was able to swap out a Display Pack V2 with one of the V2.8’s and get an bigger easier on the eyes display. It was already using a Pico 2040. The only code edit was the RGB LED pins. I don’t use the LED on that device. I do use the buttons, but they work fine on an Pico RP2040. It’s basically a desktop clock with weather info via a BME280.

I have a Plasma 2040 Stick that I use to control desktop ambient lighting. I’m likely going to wait a while before I buy any custom RP 2350 boards.

I really wish they would get their ducks in a row , software wise, before releasing new hardware.

@alphanumeric

Yes I would bet your button issue is due to the “Errata 9”. I have a pico keypad I made with 8 polled momentary switches using internal pull-downs. I put a Pico 2 in at the weekend to try out and it doesn’t work at all. Was pulling my hair out trying to figure out what was going on and then saw the post on the PI forums!. Also looks like if using external pull down you need to keep the value quite low, like < 9K. Something will have to watch out for!

Regards

Using the following gets it working. @hel passed it on to me via a support e-mail.

from machine import Pin

button_a = Pin(12, Pin.IN, Pin.PULL_UP)
button_b = Pin(13, Pin.IN, Pin.PULL_UP)
button_x = Pin(14, Pin.IN, Pin.PULL_UP)
button_y = Pin(15, Pin.IN, Pin.PULL_UP)

if button_a.value() == 0:
    # etc etc

My full file is as follows.

# This example shows you a simple, non-interrupt way of reading Pico Display's buttons with a loop that checks to see if buttons are pressed.
# If you have a Display Pack 2.0" or 2.8" use DISPLAY_PICO_DISPLAY_2 instead of DISPLAY_PICO_DISPLAY

import time
from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2, PEN_P4
from pimoroni import RGBLED

# We're only using a few colours so we can use a 4 bit/16 colour palette and save RAM!
display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_P4, rotate=0)

display.set_backlight(0.5)
display.set_font("bitmap8")

from machine import Pin

button_a = Pin(12, Pin.IN, Pin.PULL_UP)
button_b = Pin(13, Pin.IN, Pin.PULL_UP)
button_x = Pin(14, Pin.IN, Pin.PULL_UP)
button_y = Pin(15, Pin.IN, Pin.PULL_UP)



# Set up the RGB LED For Display Pack and Display Pack 2.0":
# led = RGBLED(6, 7, 8)

# For Display Pack 2.8" uncomment the line below and comment out the line above:
led = RGBLED(26, 27, 28)

WHITE = display.create_pen(255, 255, 255)
BLACK = display.create_pen(0, 0, 0)
RED = display.create_pen(255, 0, 0)
BLUE = display.create_pen(0, 0, 255)
YELLOW = display.create_pen(255, 255, 0)
GREEN = display.create_pen(0, 255, 0)


# sets up a handy function we can call to clear the screen
def clear():
    display.set_pen(BLACK)
    led.set_rgb(0, 0, 0)
    display.clear()
    display.update()


# set up
clear()

while True:
    if button_a.value() == 0:
        clear()                                           # clear to black
        display.set_pen(RED)                            # change the pen colour
        led.set_rgb(255, 0, 0)                        # set the LED colour to match
        display.text("Button A pressed", 10, 10, 240, 4)  # display some text on the screen
        display.update()                                  # update the display
        time.sleep(1)                                     # pause for a sec
        clear()                                           # clear to black again
    elif button_b.value() == 0:
        clear()
        display.set_pen(GREEN)
        led.set_rgb(0, 255, 0)
        display.text("Button B pressed", 10, 10, 240, 4)
        display.update()
        time.sleep(1)
        clear()
    elif button_x.value() == 0:
        clear()
        display.set_pen(BLUE)
        led.set_rgb(0, 0, 255)
        display.text("Button X pressed", 10, 10, 240, 4)
        display.update()
        time.sleep(1)
        clear()
    elif button_y.value() == 0:
        clear()
        display.set_pen(YELLOW)
        led.set_rgb(255, 255, 0)
        display.text("Button Y pressed", 10, 10, 240, 4)
        display.update()
        time.sleep(1)
        clear()
    else:
        display.set_pen(WHITE)
        led.set_rgb(0, 0, 0)
        display.text("Press any button!", 10, 10, 240, 4)
        display.update()
    time.sleep(0.1)  # this number is how frequently the Pico checks for button presses
2 Likes