Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Magic 8 Ball Game - Mystic Meg
- from sense_hat import SenseHat # Capital S and H needed
- from random import choice
- from time import sleep
- sense= SenseHat()
- #print("Ask me a question >> ")
- sense.show_message("Ask me a question >> ", scroll_speed = 0.06)
- sleep (3) # 3 second delay
- replies = ["I'm not sure",
- "most definitely",
- "Hmm let me think about that",
- "Looking Good",
- "Signs point to yes",
- "Not a chance",
- "I think thats a posibility",
- "Better ask someone else!"]
- """
- while True:
- x, y, z = sense.get_accelerometer_raw().values()
- x = abs(x)
- y = abs(y)
- z = abs(z)
- #print(choice(replies))
- if x>2 or y>2 or z >2 :
- else:
- sense.clear()
- """
- while True:
- for event in sense.stick.get_events():
- # Check if the joystick was pressed
- if event.action == "pressed":
- sense.show_message(choice(replies), scroll_speed = 0.06)
- else:
- sense.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement