tftui User Inteface module =========================== The tftui module implements the UI user interface class to provide several different methods to allow user interaction with the TurtlePlotBot using LCD Display and five way button. Methods are provided to display menus, data, individual input fields and forms containing multiple fields. Menu example program -------------------- Example program to show a menu of numbers that the user can select and show the number picked. Pressing the left button will exit the menu and program. tftui menu_example.py running on the ESP32 DrawBot Board: =================================== ==================================== .. image:: images/menu-example1.jpg .. image:: images/menu-example2.jpg =================================== ==================================== | .. literalinclude:: ../../examples/menu_example.py :linenos: :language: python Form example program -------------------- Here is an example of a MicroPython program that will show a form that allows the user to specify the number of points and the length of the sides of a star to be drawn and then draws it. .. figure:: images/stars.jpg :align: center tftui stars.py program running on the ESP32 DrawBot Board .. literalinclude:: ../../programs/stars.py :linenos: :language: python LCD Graphics Example --------------------- This example is a little more complicated, it lets the user select the size, text and font to write a message using the TurtlePlotBot. A preview of the message is shown on the display drawn in the font that was selected. ================================ ================================= .. image:: images/message-1.jpg .. image:: images/message-2.jpg .. image:: images/message-3.jpg .. image:: images/message-4.jpg .. image:: images/message-5.jpg .. image:: images/message-6.jpg ================================ ================================= Here are a few examples of the available fonts. ================================ ================================= .. image:: images/message-7.jpg .. image:: images/message-8.jpg .. image:: images/message-9.jpg .. image:: images/message-10.jpg ================================ ================================= I'm not claiming the TurtlePlotBot has the accuracy or resolution to do these fonts justice, but it can try. message.py program ^^^^^^^^^^^^^^^^^^ .. literalinclude:: ../../programs/message.py :linenos: :language: python Five way switch schematic ------------------------- Here is the schematic for the five way switch if you are building your own device and would like to use the tftui module. .. figure:: images/Schematic_5-way-switch.svg :align: center default five way switch configuration as configured on the ESP32 DrawBot board. tftui.UI class reference ------------------------- .. autoclass:: tftui.UI :members: :exclude-members: _head, HEAD, _center, CENTER, _string, STR, _integer, INT, _text, TEXT, _select, SEL, UI_HEAD, UI_CENTER, UI_STR, UI_INT, UI_TEXT, UI_SEL, UI_VAL, UI_FLD