Git Product home page Git Product logo

adafruit_ili9341_menu's Introduction

Version 1.0 updated 1/11/2021

  1. Initial library posting
  2. Added support for Touch input

Menu System for Adafruit_ILI9341 displays with touch or mechanical input

This library will simplify creating and implementing a menu system for TFT displays that use the Adafruit_ILI9341 displays with microcontrollers such as the ESP32. See my other repository for the ILI8341_t3 for Teensy-based projects.
This library includes two menu objects

  1. A simple selection menu (ItemMenu) where the user can scroll up/down and select an item and some programmer defined action can be performed such as drawing a screen or activating a sub menu
  2. A menu with in-line edit capability (EditMenu) where the user can scroll up/down the list and select an item however, the difference is that move/up down on a selected item will then scroll the values stored with that menu item, selecting a selected item will restore control to moving up/down the menu list

Watch this YouTube video to see the library with touch input: https://youtu.be/wfMcTC3_8bI
Watch this YouTube video to see the library with mechanical input: https://youtu.be/KUi9f4hcV6A


To activate touch usage specify true in the menu object creation step
  • EditMenu(Adafruit_ILI9341 *YourDisplayObject, true);
  • ItemMenu(Adafruit_ILI9341 *YourDisplayObject, true);

To activate mechanical input usage specify false (default) in the menu object creation step
  • EditMenu(Adafruit_ILI9341 *YourDisplayObject, false);
  • ItemMenu(Adafruit_ILI9341 *YourDisplayObject, false);


Library highlights
  • Support for menu selections using touch screens
  • Support for menu selections using mechanical input such as rotary encoders or buttons
  • Automatic wrapping for menu rows that exceed screen size
  • For EditMenu objects, edits can be within a defined range or from an array
  • Menus can include no icon, mono icon, or color icons
  • Programmer has full control over margins, colors, fonts, etc.
  • Menus can have up to 15 items, but expandable to more by editing the #define MAX_OPT 15
  • Menu items can be enabled or disabled through code
  • Automatic wrapping during editing for items within editable menus
  • Menu item text can be changed at any time through code
  • Initial data in EditMenu objects can be set based on stored or set values
  • Menu selector bars can have round or sharp corners and have a border to accentuate selection
  • Automatic up/down arrows on top and bottom screen rows to indicate to the user "there's more"


While this library was created for Adafruit_ILI9341 drivers, the library can be adapted 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,... and in the .cpp files you may have to change how fonts are passed in using either setFont(&SomeFont) or setFont(SomeFont)

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



I have included an example that shows how to create multi-menu system with both a simple select menu that call editable menus

header image header image



Revision history


1.0 1/11/22 initial code
2.0 1/28/22 added touch support

adafruit_ili9341_menu's People

Contributors

kriskasprzak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.