Not sure if this is easily possible or not, I'm hoping it is.
I'm playing around with the PiFace CAD (http://www.piface.org.uk/products/pifac ... d_display/). Which is nice, except when there is more than 16 characters that you want to display then you have to scroll the text across the screen ... which isn't so nice.
I've written a little test program that gets the input from the user and then scrolls the text around and around on the LCD screen. All good except that in scrolling the screen this takes up the focus of the program and the user can't enter anything else. This is very much just a simple test/sandbox type program that I quickly put together to illustrate what I'm trying to achieve.
Can this be done ? I want to be able to launch the function scroll_lcd and for it then to just run happily away in the background.
Code: Select all
import pifacecad import time #Set up the CAD cad = pifacecad.PiFaceCAD() cad.lcd.backlight_on() #Function to scroll the lcd screen def scroll_lcd(): var=1 while var == 1: cad.lcd.move_left() time.sleep(0.4) #Main body of program. Collect the users input and output it to the LCD screen #and then scroll var = 1 while var == 1: line_1_input = input() cad.lcd.clear() cad.lcd.write (line_1_input) scroll_lcd()
I've been thinking about this and I think I could achieve this by running the scroll function as a separate script (and I could pass the text that I want it to display via a text file / MySQL Database / XML which one program writes to, the other picks up and displays on the LCD screen ..... but only if that really is the best way.
Any help/advice would be very much appriciated