Hey all!
I just took receipt of my new Pico’s and Display Pack 2.0, and followed the basic startup guide to verify it worked, however I’m getting some strange behavior. Upon first few uses, it seemed like it had some sort of life, with the LED having the Red and Blue LED’s turn on. I took this as some kind of success, and followed on by flashing the pimoroni-pico-v1.20.2-micropython.uf2
firmware, and it seemed to take nicely as Thonny picked up my COM port. I then File>Open’d a simple example (I thought), the rainbow.py
file. I loaded it up, hit run, and nothing. I realised in the comments that it was a bit more RAM intensive as it was a higher colour depth, so I tried some other ones, all with nothing happening. I then searched it up, found out I needed to make it DISPLAY_PICO_DISPLAY_2
instead of DISPLAY_PICO_DISPLAY
but still nothing. On one attempt, the backlight did seem to come on, but the display was black.
After some fiddling around, eventually I noticed the LED was no longer partly lit. During experimentation, I pressed some buttons to see if one of them was an “On” switch, however it seemed to disconnect the Pico from my computer as it’d make "the noise"™ then reconnect after release, as well as Thonny saying Connection lost --EOF
. I then tried holding a/a combination of buttons just in case there was a lock of some description, however upon holding a button for more than around 3 seconds (and after "the noise"™ played), I’d get an error thrown up in windows about a power surge on a USB device trying to draw more power than the port was able. This was on both a USB 3.0 and 3.1 port, so it should be able to power a tiny display.
If you’re thinking “this sounds like a hardware fault”, then you’re not alone. But I just cannot work out how that’d happen. I installed (with some difficulty) the display as per the instructions (only pressing on the circuit board and not the micro-USB) and it’s definitely seated correctly. I got an H version specifically for this, so the next step would be soldering headers myself, but I’d rather not do that as I had alternate plans.
If anyone has any ideas, or extra steps, I’d greatly appreciate it! Otherwise, I guess it’s an RMA.
Thanks all,
Guffy.
Try this It works on my Pico and Display 2.0 with
MicroPython v1.20.0, pico v1.20.1 on 2023-04-28; Raspberry Pi Pico with RP2040 the Pimoroni version
import time
import random
from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2, PEN_P8
display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_P8)
display.set_backlight(1.0)
WIDTH, HEIGHT = display.get_bounds()
# We're creating 100 balls with their own individual colour and 1 BG colour
# for a total of 101 colours, which will all fit in the custom 256 entry palette!
class Ball:
def __init__(self, x, y, r, dx, dy, pen):
self.x = x
self.y = y
self.r = r
self.dx = dx
self.dy = dy
self.pen = pen
# initialise shapes
balls = []
for i in range(0, 100):
r = random.randint(0, 10) + 3
balls.append(
Ball(
random.randint(r, r + (WIDTH - 2 * r)),
random.randint(r, r + (HEIGHT - 2 * r)),
r,
(14 - r) / 2,
(14 - r) / 2,
display.create_pen(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)),
)
)
BG = display.create_pen(40, 40, 40)
while True:
display.set_pen(BG)
display.clear()
for ball in balls:
ball.x += ball.dx
ball.y += ball.dy
xmax = WIDTH - ball.r
xmin = ball.r
ymax = HEIGHT - ball.r
ymin = ball.r
if ball.x < xmin or ball.x > xmax:
ball.dx *= -1
if ball.y < ymin or ball.y > ymax:
ball.dy *= -1
display.set_pen(ball.pen)
display.circle(int(ball.x), int(ball.y), int(ball.r))
display.update()
time.sleep(0.01)
There are several things you have to get right at the top of the program to get things to work. Once you have got it working just cut & paste to the top if a new project.
Hope you get it working
Thank you for your reply. Unfortunately, this also didn’t work. I did play around with some of the settings called at the beginning, however they made no change. Additionally, pressing any button (ABXY) still plays the disconnected device noise, the connected device noise when released, and the warning of a power surge upon hold.
I appreciate your time to look at my comment and leave a reply though!
Is there any kind of debug route I could go? A simple “This device is connected”, “This button is pressed/released”, etc. It does seem like a short somewhere, which doesn’t make sense to only happen when a button is pressed. I’ve tried much lower backlight brightness’s too in the event the screen itself is drawing too much power, but that seems ludicrous for such a small LCD panel.
Button test program:
# Button Test
import time
from pimoroni import Button
from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2, PEN_P4
# 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")
button_a = Button(12)
button_b = Button(13)
button_x = Button(14)
button_y = Button(15)
WHITE = display.create_pen(255, 255, 255)
BLACK = display.create_pen(0, 0, 0)
CYAN = display.create_pen(0, 255, 255)
MAGENTA = display.create_pen(255, 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)
display.clear()
display.update()
# set up
clear()
while True:
if button_a.read(): # if a button press is detected then...
clear() # clear to black
display.set_pen(WHITE) # change the pen colour
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.read():
clear()
display.set_pen(CYAN)
display.text("Button B pressed", 10, 10, 240, 4)
display.update()
time.sleep(1)
clear()
elif button_x.read():
clear()
display.set_pen(MAGENTA)
display.text("Button X pressed", 10, 10, 240, 4)
display.update()
time.sleep(1)
clear()
elif button_y.read():
clear()
display.set_pen(YELLOW)
display.text("Button Y pressed", 10, 10, 240, 4)
display.update()
time.sleep(1)
clear()
else:
display.set_pen(GREEN)
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
Try this
Same behavior on the PC side, and without a working display, I can’t know if it’d change colours. This is one of the programs I tested as well. LED’s still aren’t coming on either.
Did you Pico come with the header already soldered on, or did you do the soldering?
Double check that the Display Pack is plugged into the Pico with the correct orientation.
I got an H version specifically for this, so the next step would be soldering headers myself, but I’d rather not do that as I had alternate plans. It is definitely in the correct orientation as well.
OK, I had to rule out the usual suspects. There is nothing wrong with going with the with header option. If you hadn’t, the next question would have been to post a picture of the soldering. ;)
I have several Display Packs here and have never seen an issue like this, not personally, or posted on the forum. Might be time to give tech support an e-mail.
Contact Us for Raspberry Pi Technical Support - Pimoroni
Thank you, I just wrote in a support ticket and linked back to my original post. I believe all info is in there, including troubleshooting steps I have already taken. I gave a short, abridged version, but I didn’t really waste a sentence in my OP.