How to flip my entire touchscreen code/display

Hi All,

I have a pico + waveshare 2.8” restouch display with a bunch of text, graphics, and some mapped touchscreen buttons.

Just realised that with how I plan to mount it, I would prefer if the usb port was on the top (it’s currently landscape, and usb cord is on the bottom).

Is there a relatively easy way to just…flip everything so the usb port will physically be on the top, but I don’t need need to remap or mess with much? I really struggled with calibrating and mapping my touchscreen buttons.

Hi there, @Leigh169924,

It’s definitely doable, but whether or not it’s easy will depend on what the code looks like.

The Pico + Waveshare 2.8" touch you’re using, is it this one:

If so, I’ve noticed that their simplemenu.py includes a rotation setting you can set on initialisation of the Picographics class:

display = PicoGraphics(display=DISPLAY_PICO_DISPLAY_2, pen_type=PEN_RGB565, rotate=0)

I would start with playing around with that and seeing if it makes any difference.

Thanks Jane, I will play around with that and see. I had another question about my setup (wasn’t sure if I should just make a new post or ask here, but just in case you may have an idea on this also) - I’m having difficulty getting my code to run on power up. Works fine through Thonny and VS. I save as main.py, bootsel and put on pi. Then nothing when I power it up either through the same PC USB I was using to code or through a separate USB - power source. UF2 is on there, and I tried clearing and redownloading it again and nothing.

Any ideas?

1 Like

Hey there, Leigh,

That’s certainly odd behaviour.

Typically, with the Pico, you only need to press Bootsel only when you’re flashing it with firmware. Every other time, you just need to connect it via USB. I’m wondering if holding down the Bootsel is preparing the Pico to be flashed so it can’t access its flash memory and thus your program.

Otherwise, would you be able to upload a picture of your Pico’s directory and the code in your main.py so we can see if there is anything specific that could be causing this problem?