Example #1
0
def test():
    print('''Main screen populates text boxes slowly to show
    clipping and wrapping in action. "Fast" screen
    shows fast updates using internal font. "Tab"
    screen shows use of tab characters with Python
    font.
    Text boxes may be scrolled by touching them near
    the top or bottom.''')
    setup()
    Screen.change(TScreen)
Example #2
0
def test():
    print('Test TFT panel...')
    setup()
    Screen.change(BaseScreen)  # Run it!
Example #3
0
def test():
    print('Test TFT panel...')
    setup()  # Initialise GUI (see tft_local.py)
    Screen.set_grey_style(desaturate=False)  # dim
    Screen.change(VerticalSliderScreen)  # Run it!
Example #4
0
# ra8875_test.py Test program for ra8875 driver.

# Released under the MIT License (MIT). See LICENSE.
# Copyright (c) 2019 Peter Hinch

from utime import sleep_ms, ticks_us, ticks_diff
import micropython_ra8875.fonts.font10 as font10
from micropython_ra8875.py.colors import *  # Colors
from micropython_ra8875.driver.tft_local import setup

tft = setup(True, False)  # No asyncio

# Draw basic shapes
x = 10
y = 10
tft.fill_rectangle(x, y, x + 40, y + 40, RED)
x += 50
tft.draw_rectangle(x, y, x + 40, y + 40, GREEN)
x += 50
tft.draw_clipped_rectangle(x, y, x + 40, y + 40, YELLOW, 5)
x += 50
tft.fill_clipped_rectangle(x, y, x + 40, y + 40, BLUE, 5)

y += 20
x += 70
tft.fill_circle(x, y, 20, RED)
x += 50
tft.draw_circle(x, y, 20, GREEN)

# Test line drawing
x = 10
Example #5
0
# cal.py Calibration utility for ra8875 driver.

# Released under the MIT License (MIT). See LICENSE.
# Copyright (c) 2019-2020 Peter Hinch

# Updated for uasyncio V3

import uasyncio as asyncio
import uos as os
import sys
from micropython_ra8875.py.colors import *  # Colors
from micropython_ra8875.driver.tft_local import setup

tft = setup(True, True)

ll = 20  # Crosshairs for calibration
lc = YELLOW
tft.draw_hline(0, 0, ll, lc)
tft.draw_vline(0, 0, ll, lc)
tft.draw_hline(tft.width() - ll - 1, tft.height() - 1, ll, lc)
tft.draw_vline(tft.width() - 1, tft.height() - ll - 1, ll, lc)

msg1 = '''To calibrate touch the screen at the top left
and bottom right hand corners of the screen
where the yellow lines meet - ideally with a
stylus.
When you have done this, press ctrl-c.
You will have the option to update tft_local.py.

Press ctrl-c to continue.'''
Example #6
0
            await sr.readexactly(3)  # discard VT100
            process_char('Bs', tb)
            continue
        else:
            await asyncio.sleep_ms(10)
            n = uart.any()
            if n:  # rapid input: assume programmatic
                s = await sr.readexactly(n)
                s = s.decode().replace('\r','')
                #for char in s:
                    #print('s:', char, hex(ord(char)))
                tb.append(''.join((ch, s)), ntrim = NLINES)  # TODO splits line on tab expansion because tb.append puts on new line
            else:
                process_char(ch, tb)


class KBD(Screen):
    def __init__(self):
        super().__init__()
        uart = UART(1, 115200, read_buf_len=256)
        sreader = asyncio.StreamReader(uart)
        quitbutton()
        tb = tbox(0, 280)  # Create textbox
        keys = make_keys(uart)  # Create normal keys
        ctrl(uart, keys)  # Create control keys
        self.reg_task(handle_input(uart, sreader, tb))

print('Test TFT panel...')
setup()  # Initialise GUI (see tft_local.py)
Screen.change(KBD)       # Run it!
Example #7
0
def test():
    print('Test TFT panel...')
    setup()  # Initialise GUI (see tft_local.py)
    Screen.change(KBD)       # Run it!
def test():
    setup()
    Screen.change(BaseScreen)
Example #9
0
def pt():
    print('Testing plot module...')
    setup()
    Screen.change(BaseScreen)
Example #10
0
def test():
    print('Test TFT panel...')
    setup()
    Screen.change(KnobScreen)
def test():
    print('Testing TFT...')
    setup()
    Screen.change(ButtonScreen)
Example #12
0
def test():
    setup()
    Screen.change(ChoiceScreen)
Example #13
0
def test():
    print('Test TFT panel...')
    setup()
    Screen.set_grey_style(desaturate = False) # dim
    Screen.change(SliderScreen)       # Run it!