KrisKasprzak / ILI9341_t3_controls

Graphical slider controls for TFT LCD type displays
30 stars 65 forks source link

Version 6.1 updated 4/4/2023

  1. added support for setting fill and outline for pressed button color
  2. added support for legend offset

Version 6.0 updated 2/18/2023

  1. added support for icons on buttons (color545 and mono)

Version 5.5 updated 11/18/2022

  1. Improved centering for buttons and graphing text (now uses measureTextWidth(), measureTextHeight() from the ILI9341_t3 library)

Version 5.4 updated 12/20/2021

  1. Added a ring slider

Version 5.31 updated 4/7/2021

  1. Fixed snap issue in horizontal slider and draw issue with double triangle in horizontal slider

Version 5.3 updated 4/7/2021

  1. added code to redraw changed handles, where handle size with setHandleSize(val), or shape with setHandleShape(val), was changed after the init(). Classic use case is where a triangle handle is to be used for low values, a square for high values. Note if handle color is changed dynamically, just call draw(and the value).

Slider Controls for Touchscreen Displays

This library will let programmers add graphkical objects such as 1) horizontal bar chart 2) vertical bar chart 3) cartesian graph 4) dial and 5) slider controlss to their projects. This library is intended to be used with ILI9341_t3 libraries and TFT LCD's that support touch. Typical applications are graphing temperatures, voltages, etc. as wel as providing UI controls for adjusting volume, brightness and on/off capability. Multiple controls can be added allow the UI creation par charts that report pin reads and sliders to adjust output levesl. Most of these objects support multiple ceation, location control, color control as other options.

While this library was created for the ILI9341_t3 and intended for Teensy-based MCU's, the library may be adaptable to other display drivers. Note the driver must use the Adafruit_GFX libraries. To allow other display drivers, modify the lines in the .h and .cpp files to allow a different driver to be passed in. For example change call such as SliderH(ILI9341_t3 disp,... to SliderH(Adafruit_RA8875 disp,...

header image header image header image header image header image header image header image



This library also has controls for 1) buttons 2) check boxes and 3) option buttons

header image header image header image

I have included a bonus example that shows how to create multi-screen interface
header image header image header image



Revision history


1.0 initial code
2.0 added shapes and sizes for handles
3.0 fixed some repaint issues in CGraph, added marker support, added Button class with tons of methods
4.0 fixed bugs added Button, Checkbox, OptionButton classes
5.0 modified sliders, option and check to return true/false if pressed, and actual value stored in value property
5.1 added automatic "blank out" old handle support insided draw() method in sliderH and SliderV (really needed when a slide is redrawn based on input other than a finger slide (encoder)
5.4 Added ring sliders