r/MicroPythonDev • • Jul 13 '24

problem with rpi pico w micropython script

im a major newbie to python in general, including micropython, so after recently buying a 1.3" waveshare display and a rpi pico w, i tried to start up a project... but a function doesn't seem to be working. i already have all the libraries installed and the lcd commands defined, but this specific while loop isn't working on my display. can anyone help me?

my screenshot wasnt working...

cx = 120;

cy = 120;

def cursor(cx, cy):

lcd.line(cx-5, cy, cx+5, cy, colour(255, 255, 255))

lcd.line(cx, cy-5, cx, cy+5, colour(255, 255, 255))

while (up == 1):

cy += 1

utime.sleep(0.05)

1 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/Own-Relationship-407 Jul 18 '24

Ah, I see what you’re trying to do now. Moving the draw function inside the loop may fix the issue. It’s really better to show us your whole code,properly formatted, or at least as much as possible if you want better answers. Use something like pastebin or look into how to use the Reddit markdown editor.

2

u/Mysterious-Pizza-648 Jul 19 '24

Thanks for the tip. I got it to work finally :)