Quantcast
Channel: Support - Pimoroni Buccaneers
Viewing all articles
Browse latest Browse all 6853

Scroll pHAT HD Scrolling Issues

$
0
0

@alexmburns wrote:

Hello there,

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 random
import signal
import time
import scrollphathd as sphd

def roll(sides=6):
num_rolled = random.randint(1,sides)
return num_rolled

def main():
sides = 6
rolling = True
while rolling:
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)
sphd.show()
sphd.scroll(1)
time.sleep(0.05)

else:
	rolling = False

	print ("You We're On A Roll!")

main()

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6853

Trending Articles