Esempio n. 1
0
# imports to turn the screen on
from tg_modules.tg_rgb import rgb, ili9341
from tg_modules.make_ios import dio
import busio, board, pulseio, time

from displayio import release_displays

release_displays()

#setup disp
disp = ili9341.ILI9341(busio.SPI(board.SCK, board.MOSI, board.MISO),
                       dio(board.TFT_WR, 0), dio(board.TFT_CS, 0),
                       dio(board.TFT_RESET, 0))
time.sleep(.01)
backlight = pulseio.PWMOut(board.TFT_BACKLIGHT)
backlight.duty_cycle = 2**16 - 1

del release_displays

# rest of imports
from tg_gui import gui, system, system_handler, _resources
import random, gc, supervisor, digitalio, adafruit_touchscreen

gc.enable()

#touchscreen setup
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL,
                                      board.TOUCH_XR,
                                      board.TOUCH_YD,
                                      board.TOUCH_YU,
                                      calibration=((5200, 59000), (5800,
Esempio n. 2
0
clean_mem()

#start backlight in off position
#backlite = dio(backlight,0,False)
#backlite.value = False
backlite = pwm(backlight, 0)
del backlight
clean_mem()

#imports
from TG_Modules.TG_RGB.rgb import colorst as color
from TG_Modules.TG_RGB.st7735r import ST7735R

#setup the display as a car named "disp"
disp = ST7735R(disp_spi,
               cs=dio(disp_cs),
               dc=dio(disp_dc),
               rst=dio(disp_rst),
               rotation=1)

disp.fill(0)

#reset again
disp.reset()
disp.init()

del disp_spi, disp_cs, disp_dc, disp_rst
clean_mem()

#start with black screen and elimiate noise
disp.fill(0)
Esempio n. 3
0
from gc import collect as clean_mem
#import pins
from staging.pin_port import disp_spi,disp_cs, disp_dc, disp_rst, backlight
clean_mem()
# import easy digital io
from tg_modules.make_ios import dio
clean_mem()


#start backlight in off position
backlite = dio(backlight,0,False)
backlite.value = False
del backlight
clean_mem()

from adafruit_rgb_display.rgb import colorst
from adafruit_rgb_display.st7735r import ST7735R

disp = ST7735R(disp_spi, cs=dio(disp_cs),
               dc=dio(disp_dc),rst=dio(disp_rst),rotation = 1)
del disp_spi,disp_cs, disp_dc, disp_rst
clean_mem()

disp.fill(0)

backlite.value = True




def print_credit():
Esempio n. 4
0
'''try:
    utx = board.TX
    urx = board.RX
    uart_port = busio.UART(utx, urx, baudrate=9600, timeout=3000)
except Exception as e:
    print('TG:HW: unable to create uart port')
    print(e)'''

#spi for display
try:
    backlight = board.D9
    disp_sck = board.SCK
    disp_mosi = board.MOSI
    disp_miso = board.MISO
    disp_cs = board.D8
    disp_dc = board.D7
    disp_rst = board.D10
    disp_spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
except Exception as e:
    print('TG:HW: unable to create DISP SPI port')
    print(e)

try:
    spkr_pin = board.A1
    spkr_en_pin = board.A2
    spkr_en = ezio.dio(spkr_en_pin, 0)
    spkr = ezio.sndio(spkr_pin)
except Exception as e:
    print('TG:HW: unable to create spkr pins')
    print(e)