Configure GUIslice for Arduino - ImpulseAdventure/GUIslice GitHub Wiki (2024)

Overview > Configuring GUIslice >

This guide describes the steps to configure the GUIslice library for Arduino and related devices

  • Arduino UNO (ATmega328P)
  • Arduino Pro Mini (ATmega328P)
  • Arduino Mega (ATmega2560)
  • ... and many other similar devices

Return to GUIslice Config Guide

For Arduino devices, GUIslice can be built either within the Arduino IDE (recommended for most users) or within PlatformIO. This guide will describe operation within the Arduino IDE, documentation for PlatformIO may be written at a later date.

Important NoteDue to a bug in the Arduino IDE compiler, it is important that the Arduino AVR Boards is not set to version 1.6.22 or 1.6.23. Please refer to the Installing GUIslice for Arduino guide.

As is the case with any library, you must determine exactly which Display Driver is appropriate for your display device. In most cases this will be marked on the product page. In the case of the cheaper eBay knock-offs, it can sometimes be more challenging to determine this, especially because received parts don't always match the listing.

Display modules may also incorporate a resistive (res) or capacitive (cap) touch capability. These modules will generally have a separate Touch Driver, which may be marked on the product info. In some cases, a display with a resistive overlay will provide an analog 4-wire interface without a controller. In these cases, the -simple analog 4-wire touch driver (DRV_TOUCH_ADA_SIMPLE) should be selected. If no touch support is provided / desired, the -notouch driver (DRV_TOUCH_NONE) should be selected.

For a list of common displays and the recommended drivers, please refer to:

By convention, the Example Configurations are named as: (cpu)-(display_driver)-(display_controller)-(touch_controller)-cfg###.h.

At this time, the following example configs are provided:

CPUDisplay DriverTouch DriverExample ConfigNotes
ArduinoILI9341Noneard-adagfx-ili9341-notouch.h
ArduinoILI9341STMPE610 (res)ard-adagfx-ili9341-stmpe610.h
ArduinoILI93414-wire (res)ard-adagfx-ili9341-simple.h
ArduinoILI9341FT6206 (cap)ard-adagfx-ili9341-ft6206.h
ArduinoILI9341GPIOard-adagfx-ili9341-input.h
ArduinoST7735Noneard-adagfx-st7735-notouch.h
ArduinoSSD1306Noneard-adagfx-ssd1306-notouch.h
ArduinoHX8357Noneard-adagfx-hx8357-notouch.h
ArduinoHX8357STMPE610 (res)ard-adagfx-hx8357-stmpe610.h
ArduinoHX83574-wire (res)ard-adagfx-hx8357-simple.h
ArduinoHX8357FT6206 (cap)ard-adagfx-hx8357-ft6206.h
ArduinoPCD8544Noneard-adagfx-pcd8544-notouch.h
ArduinomcufriendNoneard-adagfx-mcufriend-notouch.h
Arduinomcufriend4-wire (res)ard-adagfx-mcufriend-simple.h
ArduinomcufriendSTMPE610 (res)ard-adagfx-mcufriend-stmpe610.hComing soon
ArduinomcufriendFT6206 (cap)ard-adagfx-mcufriend-ft6206.hComing soon
  • More examples will appear shortly...

Take note of the Example Config that best matches your setup, as you will be selecting this file in Step 4.

Before attempting to run GUIslice, it is essential that the standalone graphics example included in the Adafruit-GFX display library has been configured and runs correctly. If the Adafruit example code doesn't work, GUIslice will not work, so please don't skip this step!

In all cases, the Adafruit-GFX base graphics library needs to be installed first.

For example, if you are intending to use an ILI9341-based display, then open the Adafruit-ILI9341 graphics example:

  • File → Examples → Adafruit ILI9341 → graphicstest
  • Modify the TFT_* pin settings in the sketch to match your shield connections or manual wiring
  • Configure GUIslice for Arduino - ImpulseAdventure/GUIslice GitHub Wiki (1)
  • Confirm that the example successfully compiles and runs, showing a series of display patterns
  • For more details, please refer to the Adafruit display library documentation (eg. Connecting Adafruit 2.8" Touch Shield)
  • For any other devices, please locate the corresponding Adafruit display driver library and run its corresponding graphicstest sketch

MCUFRIEND users

If your display has been marked with "mcufriend" then please download and install David Prentice's MCUfriend_kbv library. After installing the library, please run the following example instead of the Adafruit examples:

  • File → Examples → MCUFRIEND_kbv → diagnose_TFT_support
    • Confirm that the example successfully compiles and runs, and reporting no errors on the serial monitor. The display should probably show a colored screen with a message like ID=0x9341.
  • File → Examples → MCUFRIEND_kbv → graphicstest_kbv
    • Confirm that the example successfully compiles and runs, showing a series of display patterns
  • If either of the above sketches report errors, then please followup with the MCUfriend_kbv library for support. GUIslice will not work correctly unless these examples are working!

The GUIslice library supports a large number of microcontrollers and displays. The default library configuration in Arduino mode supports the Arduino UNO / ATmega2560 with an ILI9341 display and STMPE610 resistive touch controllers, for example: Adafruit 2.8" TFT Touch Shield for Arduino with Resistive Touch Screen.

If you are using this device and display combination, then no further changes should be required to run the examples that come with GUIslice. Otherwise, read on for the changes needed to adapt for other device combinations.

GUIslice selects a configuration file to load according to the /src/GUIslice_config.h. This file includes a line for each of the example configurations provided in the /configs directory. Uncommenting one of these example configuration lines will load the corresponding config file settings. If no row is uncommented, then the default combined /src/GUIslice_config_ard.h file will be loaded.

Users can also create their own configurations by copying one of the existing example configurations and adding an uncommented row to the GUIslice_config.h file.

Please see how to locate GUIslice_config for details.

Many of the GUIslice configuration options are dictated by either #define <mode> <value> or #define <mode> lines within the config file.

In some cases the config file provides multiple related #define <mode> lines (such as DRV_DISP_*, with one line uncommented, and the remainder of the related modes commented out (with //). In order to change one of these config options, uncomment the desired mode and then comment out (or delete) the other related modes.

For other configuration modes, a single line #define <mode> <value> is provided, with a value of 0 or 1 dictating that the feature is disabled or enabled, respectively. Simply change the value between 0 and 1 as needed.

From this point onwards, references will be made to "enabling" or "disabling" a config setting, with the above convention used.

GUIslice supports a wide range of display and touch hardware in addition to the accompanying software drivers. We need to start by ensuring that GUIslice imports the appropriate display and touch drivers.

If you are using a display shield, then the pinout wiring between the microcontroller and the display is hardcoded, making it much easier to ensure proper configuration and setup. In fact, a few of the more common display combinations are provided as canned example configurations within GUIslice. If the display is not a shield, then care must be taken to note that the wiring and GUIslice's ADAGFX_PIN_* configuration matches.

Step 4A: Start with Example Configuration

Look in the GUIslice /configs directory for an example device + display + touch combination that matches your setup. In general, the example configs use the following naming convention:

  • <CPU>-<display_driver>-<display_controller>-<touch_controller>.h

If a matching configuration exists, uncomment the corresponding line in the GUIslice_config.h file. Alternately, a user config file can be linked in by adding an uncommented line with its filename in the GUIslice_config.h file. Note that only one configuration line should be uncommented.

Note that more example configurations will be added to the library over time, and users are encouraged to submit their own (if it is a combination that hasn't been provided yet).

Step 4B: Modify pinout if necessary

If you are using a shield, the example configuration pinouts may be adequate as-is. However, for any custom wiring, it is essential that the configuration matches your wiring pinout.

  • In the Adafruit example run in Step 2, look for the line that instantiates the Adafruit display (such as Adafruit_ILI9341):
  • Configure GUIslice for Arduino - ImpulseAdventure/GUIslice GitHub Wiki (2)
  • Note the settings on TFT_DC, TFT_CS, etc. that worked earlier. Copy these same values to the GUIslice_config_ard.h's ADAGFX_PIN_* settings:
  • Configure GUIslice for Arduino - ImpulseAdventure/GUIslice GitHub Wiki (3)

Now that we have the basic driver and display settings configured, it is time to test the basic operation of the GUIslice library.

Run Display Example

In the Arduino IDE, open up the ex01_ard_basic example:

  • File → Examples → GUIslice → arduino → ex01_ard_basic

Enable the Serial Monitor in the Arduino IDE:

  • Tools → Serial Monitor
  • Change the baud rate to 9600 (located in bottom right corner of window) as this is the default used in the GUIslice examples (look for the Serial.begin(9600); line). If you don't set a baud rate that matches the sketch serial initialization, random characters may be written to the display.

Run the sketch with Sketch → Upload

  • Look for any error messages reported on the Serial Monitor
  • See if the display shows a gray background with write-framed box:
  • Configure GUIslice for Arduino - ImpulseAdventure/GUIslice GitHub Wiki (4)

If the above display test works properly, then it is time to enable the touch driver and test again (if a touch device is used).

Step 6A: Ensure Touch is Configured properly

A number of configuration steps are often required to ensure that the touch presses respond as expected.

Step 6B: Run Touch Example

  • In the Arduino IDE, open up the ex02_ard_btn_txt example:
  • File → Examples → GUIslice → arduino → ex02_ard_btn_txt
  • Upload and confirm that a button responds to touch presses OK. Note that after releasing a touch on the button that the sketch is expected to "quit" and stop responding. Resetting the device will start the test again.
  • Configure GUIslice for Arduino - ImpulseAdventure/GUIslice GitHub Wiki (5)

Step 6C: Troubleshooting Touch Operation

If the touch presses don't appear to line up as expected, it may be necessary to adjust the touch-to-display mapping setting. Please refer to the Configuring Touch Support page for details.

If the display and touch appear to be working correctly, experiment by loading up the other examples provided with GUIslice. For arduino devices, these can be loaded from the Arduino IDE under:

  • File → Examples → GUIslice → arduino → ex01_ard_* (normal memory examples)
  • File → Examples → GUIslice → arduino_min → ex01_ardmin_* (minimum memory examples)

In the repository, the above examples are located in the /examples/ directory.

Step 7A: Disable Debug Messaging

In the case of Arduino devices, available RAM is very limited. Therefore, it is recommended that debug messages are disabled once the devices and basic examples are running as expected. To disable debug messaging, look for a DEBUG_ERR line in the config and change it from 1 (enabled) to 0 (disabled).

Note Regarding Memory on Arduino

It is important to note that Arduino devices based on the ATmega328P microcontroller (such as Arduino UNO, Arduino Pro Mini, etc.) are extremely limited in the amount of memory (RAM) that they provide, 2KB! In order to enable GUIs to work on these devices, it is recommended to use the GUIslice Flash-based Elements otherwise it is likely that you will encounter compiler errors indicating Not enough memory.

This section will be added soon

Configure GUIslice for Arduino - ImpulseAdventure/GUIslice GitHub Wiki (2024)

References

Top Articles
Tommy Bahama Restaurant Bar & Store The Woodlands Menu
50 Miles From Chicago
I Make $36,000 a Year, How Much House Can I Afford | SoFi
Spn 1816 Fmi 9
Nco Leadership Center Of Excellence
Mrh Forum
Overnight Cleaner Jobs
Ventura Craigs List
Directions To 401 East Chestnut Street Louisville Kentucky
Ukraine-Russia war: Latest updates
Sport Clip Hours
Immediate Action Pathfinder
Colts seventh rotation of thin secondary raises concerns on roster evaluation
Clarksburg Wv Craigslist Personals
Hoe kom ik bij mijn medische gegevens van de huisarts? - HKN Huisartsen
Google Feud Unblocked 6969
Velocity. The Revolutionary Way to Measure in Scrum
Fraction Button On Ti-84 Plus Ce
Costco Great Oaks Gas Price
Hennens Chattanooga Dress Code
Uconn Health Outlook
Hdmovie 2
Hdmovie2 Sbs
18889183540
Big Lots Weekly Advertisem*nt
Www.publicsurplus.com Motor Pool
Parc Soleil Drowning
Www.paystubportal.com/7-11 Login
Ceramic tiles vs vitrified tiles: Which one should you choose? - Building And Interiors
Delta Township Bsa
Turns As A Jetliner Crossword Clue
Motor Mounts
Club Keno Drawings
Helloid Worthington Login
Wcostream Attack On Titan
Spy School Secrets - Canada's History
Bridger Park Community Garden
South Bend Tribune Online
Second Chance Apartments, 2nd Chance Apartments Locators for Bad Credit
Hireright Applicant Center Login
Aita For Announcing My Pregnancy At My Sil Wedding
Why Are The French So Google Feud Answers
R/Gnv
Sandra Sancc
DL381 Delta Air Lines Estado de vuelo Hoy y Historial 2024 | Trip.com
York Racecourse | Racecourses.net
Wera13X
Wvu Workday
Festival Gas Rewards Log In
All Obituaries | Roberts Funeral Home | Logan OH funeral home and cremation
Stone Eater Bike Park
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 5673

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.