# Show text on pad
# On LED screen on pad will appear text from variable: text_to_show.
# If you like, change it and see how it will look.

from libraries.EduSense import Uart
from libraries.EduSense import Font



def on_key_down(key):
    if key == keys.ESCAPE:
        exit()

# You can cange line below
text_to_show = " Start the countdown 9876543210  *"
current_position = 0

def show_text():
    global current_position


    if current_position < len(text_to_show):
        uart.cmd_matrix_by_rows(Font.to_pixels(text_to_show[current_position]))
        current_position += 1

        # now it will be self sustained function, run every 0.5 sec.
        clock.schedule(show_text, 0.5)


uart = Uart.Uart()
uart.open()
show_text()
