Difference: TFTDisplay (9 vs. 10)

Revision 102020-07-30 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

TFT Displays

Introduction

Line: 157 to 156
 Again a have a few photos for you:
img_7972.png img_7973.png img_7964.png img_7965.png
Then we have all the demo programs that came with the SSD1351 driver, some of which are quite sophisticated.
Changed:
<
<
  • demo_bouncing boxes.py: shows a number of differently colored filled rectangles that bump of the the edges of the screens.
img_8003.png
>
>
  • demo_bouncing boxes.py: shows a number of differently colored filled rectangles that bump of the the edges of the screens
 
  • demo_colored_squares.py: shows a number a filled rectangles in different colors
Deleted:
<
<
img_7952.png
 
  • demo_color_palette.py:
Changed:
<
<
img_8014.png
>
>
Bouncing Boxes Color squares Color palette
img_8003.png img_7952.png img_8014.png
 As explained above, text writing in different fonts is not exactly easy. While the original SSD1351 driver loaded its fonts from C files before using them, a procedure which could take several tens of seconds, the new version uses the same fonts but converted into Python code and stored in flash together with access methods to get the pixel information. Now, no font loading is necessary any more and text drawing becomes very fast. The text drawing demo
  • demo_fonts.py
only needed minor modification to reflect this change. However, a utility script to convert the original C font to a Python font is needed.
Line: 169 to 164
 As explained above, text writing in different fonts is not exactly easy. While the original SSD1351 driver loaded its fonts from C files before using them, a procedure which could take several tens of seconds, the new version uses the same fonts but converted into Python code and stored in flash together with access methods to get the pixel information. Now, no font loading is necessary any more and text drawing becomes very fast. The text drawing demo
  • demo_fonts.py
only needed minor modification to reflect this change. However, a utility script to convert the original C font to a Python font is needed.
Added:
>
>
 
img_7958.png img_7959.png img_7960.png img_7961.png
Added:
>
>

Video games

In the list of demos for the SSD1351 driver you even find 2 simple video games:

Both games need additional hardware: a joystick in case of Super Mario and a linear potentiometer in the case of Arkanoid. demo-mario orriginally used a Bluetooth based joystick, which we don't have. I therefore replaced it with the analogue joystick from our sensor kit. Of course the software needed to be adapted correspondingly.

demo-mario arkanoid
img_8026.png  

GUI elements in nanogui

Peter Hinch's nanogui library contains a few widgets that can be used to graphically display sensor results. Their number is fairly limited (that is why Peter calls it nanogui) but extensions are possible if needed. nanogui contains:

  • a label
  • a meter
  • an led
  • a dial
I managed to get all of Peter's demo programs:
  • color15.py
  • color95.py
  • aclock.py
to work with the ST7735 driver. I did not try alevel.py, written for the pyboard and making use of its accelerometer, which is not available on our ESP32 board. The color95.py program showing the meters, was adapted to present temperature and humidity values from SHT30 measurements and I created a "Scale" widget to be used as a voltmeter in conjunction with the ESP32 ADC.Particularly interesting is also the fplot.py library allowing to plot data in cartesian or polar coordinate and which has the facility to take data in real time as they are produced by the sensor. For more details please refer to https://github.com/peterhinch/micropython-nano-gui

Here again some pictures

The clock is Peter's original clock program adapted to the ST7735. The SHT30 meters are meter widgets from nanogui connected to real measurements from the SHT30. Yes, also in Europe we can have Ghanaian temperatures! even though relative humidity is substantially lower.

The voltmeter meter application uses a Scale widget, not part of nanogui. Peter has supplied a superclass DObject (displayable object) from which the Scale widget is derived. The demo connects to the ESP32 ADC to display measured signal levels.

Plotting

Peter's nanogui repository also contains a plotting package called fplot. This package allows to produce cartesian and polar plots to be generated. Particularly interesting is a feature that allows to add real time measurements to plots as they come in.

 -- Uli Raich - 2020-07-04

Comments

Line: 197 to 224
 
META FILEATTACHMENT attachment="img_7960.png" attr="" comment="" date="1595858610" name="img_7960.png" path="img_7960.png" size="244285" user="UliRaich" version="1"
META FILEATTACHMENT attachment="img_7961.png" attr="" comment="" date="1595858610" name="img_7961.png" path="img_7961.png" size="250689" user="UliRaich" version="1"
META FILEATTACHMENT attachment="img_8014.png" attr="" comment="" date="1595937788" name="img_8014.png" path="img_8014.png" size="232908" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="img_7982.png" attr="" comment="" date="1596102560" name="img_7982.png" path="img_7982.png" size="201217" user="UliRaich" version="1"
META FILEATTACHMENT attachment="img_7984.png" attr="" comment="" date="1596102563" name="img_7984.png" path="img_7984.png" size="226659" user="UliRaich" version="1"
META FILEATTACHMENT attachment="img_7990.png" attr="" comment="" date="1596102565" name="img_7990.png" path="img_7990.png" size="209211" user="UliRaich" version="1"
META FILEATTACHMENT attachment="img_8016.png" attr="" comment="" date="1596102566" name="img_8016.png" path="img_8016.png" size="196208" user="UliRaich" version="1"
META FILEATTACHMENT attachment="img_8020.png" attr="" comment="" date="1596102569" name="img_8020.png" path="img_8020.png" size="209010" user="UliRaich" version="1"
META FILEATTACHMENT attachment="img_8025.png" attr="" comment="" date="1596102570" name="img_8025.png" path="img_8025.png" size="186133" user="UliRaich" version="1"
META FILEATTACHMENT attachment="img_8026.png" attr="" comment="" date="1596102860" name="img_8026.png" path="img_8026.png" size="411956" user="UliRaich" version="1"
 
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