I am looking for a way to make this python script repeat itself. It is the scrolling text example for the Unicornhat HD and it works great allowing you to edit the text, but once it hits the end of the text it will end the script. Would anyone know how to edit the script to make the text loop?
for scroll in range(text_width - width):
for x in range(width):
for y in range(height):
pixel = image.getpixel((x+scroll, y))
r, g, b = [int(n) for n in pixel]
unicornhathd.set_pixel(width-1-x, y, r, g, b)
unicornhathd.show()
time.sleep(0.01)
into:
while True:
for scroll in range(text_width - width):
for x in range(width):
for y in range(height):
pixel = image.getpixel((x+scroll, y))
r, g, b = [int(n) for n in pixel]
unicornhathd.set_pixel(width-1-x, y, r, g, b)
unicornhathd.show()
time.sleep(0.01)
so i tried this last night, and i must have messed something up with it, because adding the "while True: to the script causes it to not lunch. any ideas what could have gone wrong?