Skip to content

put_string draws unnecessary characters? #10

@piotrkochan

Description

@piotrkochan

I've written some code which simulates bouncing text from the wall to wall:

txt = "TEST"
width=len(txt) * 8
height=12

posx=posy=0
xmod=ymod=1

while True:
    posx += xmod
    posy += ymod
    TFT.put_string(txt, posx, posy, TFT.WHITE, TFT.BLACK, 5)

    if posx + width == 127:
        xmod = -1
    if posy + height == 127:
        ymod = -1
    if posx == 0:
        xmod = 1
    if posy == 0:
        ymod = 1
    sleep(0.005)

The result is as on the video: https://youtu.be/is2KnqieLdQ

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions