Exercise 10: A TFT Display and the ST7735 display controller

Introduction

The ST7735 is described in TFT Display on this TWiki. It comes with a big bunch of demo programs showing the functionality of the driver. Please inspect the source code of each of these demos and run them. This should give you a good feeling of the possibilities the driver offers.

Exercise 1: Random lines, rectangles and circles

Write a MicroPython script that draws 50

  • random lines
  • random rectangles
  • random circles
in random colors. These are 3 distinct tests. Draw the lines first, show them for 5s, clear the display and start showing the rectangles ...
img_8008.png img_8009.png img_8010.png
Write the above script once using direct drawing primitives (draw_line(...), draw_rectangle(...), draw_circle(...)) and then modify your code to use the primitives (line(...),rect(...),circle(...)) passing through the frame buffer. Where do you have to place the show() calls to get a similar result?

Exercise 2: Text drawing

Write a script that prints "DSCIT" in three different fonts (sysfont, courier20 and EspressoDolce18x24) in the colors red, green and blue. Draw the text once in portrait and once in landscape mode

img_8011.png

Exercise 3: Graphical User Interface (GUI) elements from nanogui

Create 2 meters, one for temperature (0..50) and one for humidity (0..100). Generate dummy temperature and humidity values and display them in the meters.

img_8012.png

Replace the dummy measurements by real ones from the SHT30.

img_8016.png

Exercise 4: Plots

Create a plot of a damped oscillator

img_8020.png

Exercise 5: A new GUI element (bonus point)

Create a new "scale" GUI element showing a scale. This should can be used e.g. to create a Voltmeter making use of the ESP32 ADC.

Exercise 6: Mario, a real challenge!

Two simple arcade games come with the SD1351 driver demos. One of them is a Super Mario game, which however is base on hardware we don't have. Can you modify the code such that you can run the program with the hardware we have (e.g the analogue joystick)?

-- Uli Raich - 2020-07-26

Comments

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng img_8008.png r1 manage 208.2 K 2020-07-28 - 06:55 UliRaich  
PNGpng img_8009.png r1 manage 211.2 K 2020-07-28 - 06:55 UliRaich  
PNGpng img_8010.png r1 manage 235.2 K 2020-07-28 - 06:55 UliRaich  
PNGpng img_8011.png r1 manage 184.5 K 2020-07-28 - 07:29 UliRaich  
PNGpng img_8012.png r1 manage 192.1 K 2020-07-28 - 11:55 UliRaich  
PNGpng img_8016.png r1 manage 191.6 K 2020-07-28 - 13:04 UliRaich  
PNGpng img_8020.png r1 manage 204.1 K 2020-07-28 - 14:28 UliRaich  
Edit | Attach | Watch | Print version | History: r12 | r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r6 - 2020-07-28 - 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