Arduino openGLCD Library Version v1.0rc2 |

All Classes Functions Variables Enumerations Enumerator Groups Pages
Configuration

Configuration is handled by a set of configuration files used to set panel and pin configuration.

The configuration capability allows creation of configuration files to support a wide choice of pins, several different processor types, and different display panels.

If you are using a standard Arduino board (168/328) or a Mega (1280/2560), Sanguino, Teensy, or Teensy++; and you have a 128x64 KS-0108 panel wired according to the pin connections table in the KS0108 Family wiring section you do not need to make any changes to configuration files and it should work "out of the box".

If you use different wiring or use a different panel type you will need to modify one of the supplied configurations or you can create your own. These configuration files set the panel parameters (display height, and width, timing, etc) to match your hardware and allows selection of the Arduino pins used to connect to the display.

While display panel timing can also be easily configured, most displays will work without requiring a configuration change for timing. However, you should check the datasheet for your panel to verify the timing values in the panel configuration file.

The active configuration when the sketch is compiled is selected in a master configuration file named openGLCD_Config.h. The default configuration file (named "config/ks0108/AutoConfig_ks0108-128x64_Panel.h") is for 128x64 ks0108 type panel. The panel configuration file naming is: "config/{PANELNAME}/AutoConfig_{PANELNAME}-{MODEL}_Panel.h" Where: {PANELNAME} is the glcd panel type. (for example, ks0108) {MODEL} is the glcd module type. (for example, 128x64, 192x64, JHD12864H, etc...)

The panel configuration file defines a board specific configuration file that specifies the pins used for each specific board type. The pin configuration file naming is a follows: "config/{PANELNAME}/PinConfig_{PANELNAME}-{BOARDNAME}.h" {PANELNAME} is the glcd panel type. (for example, ks0108) {BOARDNAME} is the name of the board (as selected in the Arduino IDE).

For example, the ks0108 pin configuration file name for a standard Arduino board is: "PinConfig_ks0108-Uno.h" The equivalent file for the "Mega" board is: "PinConfig_ks0108-Mega.h" Teensy boards are an exception. All Teensy boards share the same pin configuration file: "PinConfig_ks0108-Teensy.h"

If you change the active configuration in the master configuration file openGLCD_Config.h, make sure that one and only one configuration file is defined.

Processor type is automatically determined from the board selected when the sketch is built, this allows Arduino style pin numbers to be mapped to fast direct port IO used by the library. Pin mapping/numbering for the following board types are supported:

- Uno (ATmega8,168,328)
- Mega(ATmega1280, ATmega2560)
- Leonardo (ATmega32U4)
- Teensy, Teensy++, Teensy 3.0 (AT90USB646, AT90USB1286, ATmega32U4, ARMcortex-m4/MK20DX128)
- Sanguino (ATmega644P, Atmega1284P)
- Bobuino (ATmega644P, Atmega1284P)
- Mighty1284 (ATmega644P, Atmega1284P)
- ChipKit (Uno32, & others)

In summary:

openGLCD_Config.h defines a panel file "config/{PANELNAME}/AutoConfig_{PANELNAME}{MODEL}_Panel.h" (the active configuration) that in turn includes a board specific pin mapping file based on arduino board type, "config/{PANELNAME}/PinConfig_{PANELNAME}-{BOARDNAME}.h"

Specifying Pins