I am trying to create a simple dice roller for my Scroll pHAT HD. I have written the following (below) in Python, it works in terminal with no problems… but when I try to display it on my Scroll pHAT HD it will not scroll the text for some reason. It just shows the first part of the “You Rolled A…” string. Furthermore all subsequent sentences just appear on top of the old one… I imagine this is something to do with the clear function.
If anyone can point me in the right direction I would be very grateful.
import scrollphathd as sphd
num_rolled = random.randint(1,sides)
sides = 6
rolling = True
roll_again = raw_input("Ready to roll? ENTER=Roll.Q=Quit. ")
if roll_again.lower() !=“q”:
num_rolled = roll(sides)
sphd.write_string(“You rolled a”, num_rolled)
else: rolling = False print ("You We're On A Roll!")