Solutions to exercise 10: TFT display

Introduction

The exercises on the TFT display can be implemented on the 1.4" display with its ST7735 controller or on the 2.4" display with the ILI9341 controller. Of course the coordinates must be adapted to the different pixel resolution of the display.

Exercise 1:

The drivers for the display controller:

  • ST7735.py
  • ili934x.py
are both already included in the MicroPython binary. Try to import them for verification. Otherwise there is nothing much to be explained about the solution. The expected results are already shown on the exercise sheet.

Exercise 2:

The text fonts are also already available in the MicroPython binary. Since RAM is a scarce resource on the ESP32 we need a method allowing to have them stored in flash and get fast access to them nevertheless. The section on fonts in TFT display explains how this is done. In order ti use the font all you have to do is

import fonts.sysfont as sysfont
display.draw_text(0, 127, 'DCSIT',  sysfont, Display.RED,landscape=True)

in case of the font sysfont.

-- Uli Raich - 2021-02-06

Comments

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2021-02-06 - UliRaich
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback