Hello Everyone,
I connect the 16*2 lcd screen to my raspberry. I want to write two columns scrolling text on the lcd screen.
I use the below code for scrolling text. When I use this code on the two columns, start scrolling the first column after start scrolling the second column. How to synchronous scrolling two columns. I use delay class for time.sleep() but I didn't handle it. I also add the delay class below.
I connect the 16*2 lcd screen to my raspberry. I want to write two columns scrolling text on the lcd screen.
I use the below code for scrolling text. When I use this code on the two columns, start scrolling the first column after start scrolling the second column. How to synchronous scrolling two columns. I use delay class for time.sleep() but I didn't handle it. I also add the delay class below.
def long_string(display, text='', num_line=1, num_cols=16): """ Parameters: (driver, string to print, number of line to print, number of columns of your display) Return: This function send to display your scrolling string. """ if len(text) > num_cols: display.text(text[:num_cols], num_line) time.sleep(0.3) for i in range(len(text) - num_cols + 1): text_to_print = text[i:i+num_cols] display.text(text_to_print, num_line) time.sleep(0.3) time.sleep(0.3) else: display.text(text, num_line) def delay1(counter): start1 = time.time() while True: time.sleep(0.1) if time.time() - start1 > 1: start1 = time.time() counter = counter - 1 if counter <= 0: break
Larz60+ write Sep-06-2021, 06:44 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.