# A quick template and troubleshooting help App # for the Adafruit Mini Color TFT with Joystick FeatherWing # Included is the DisplayIO library to modify the screen output # If you connected everything correctly this code should work import time import displayio import terminalio from adafruit_display_text.label import Label from adafruit_featherwing import minitft_featherwing minitft = minitft_featherwing.MiniTFTFeatherWing() uiGroup = displayio.Group(max_size=20) text_area = Label(terminalio.FONT, text=' ', max_glyphs=20) text_area.x = 40 text_area.y = 32 uiGroup.append(text_area) minitft.display.show(uiGroup) while True: buttons = minitft.buttons if buttons.right: text_area.text = "Button RIGHT!" if buttons.down: text_area.text = "Button DOWN!"
import displayio import time import board import busio import random from adafruit_featherwing import minitft_featherwing from scripts.graphics import GraphicsHandler, make_text, Point from scripts.pressure import PressureHandler from scripts.storage import StorageHandler print("START PROGRAM") spi = board.SPI() i2c = board.I2C() minitft = minitft_featherwing.MiniTFTFeatherWing(i2c=i2c, spi=spi) graphics_handler = GraphicsHandler(minitft) storage_handler = StorageHandler(spi, i2c) dp1, dp2 = storage_handler.load_pressure_offsets() pressure_handler = PressureHandler(i2c, dp1, dp2) update_frequency = 2 # Frames per second while True: pressures = pressure_handler.measure() graphics_handler.draw(pressures) buttons = minitft.buttons # Calibrate on button press if buttons.select or buttons.left or buttons.right or buttons.up or buttons.down: graphics_handler.clear_screen() text = make_text('Calibrating...', Point(30, 30))