Do not wait for show message to finish
Posted: Fri Feb 26, 2016 4:52 pm
I have a program that relies on the joystick always being active, and if I call the function show_message(), it stops the system till the text has finished scrolling. Is there a way to stop it doing this and do it in the background? Thanks
Re: Do not wait for show message to finish
Posted: Sat Feb 27, 2016 7:57 pm
Hi there, I remember you from last time! You want to look into the Python threading
module. This allows you to kick off a function and return immediately to go onto the next line of code leaving the function to run in the background.
Code: Select all
import threading as th
from sense_hat import SenseHat
sense = SenseHat()
show_message_background("my name is Dave")
I hope this helps.