HCDisplay Arduino library for Hobby Components Displays

Useful guides, libraries, and example sketches to support our Arduino based products.
andrew
Site Admin
Posts: 1384
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by andrew » Mon Apr 03, 2023 8:51 am

The library for 12864B Parallel/Serial Graphic LCD Module (SKU: HCMODU0032) appears to be missing.

I get the following error when compiling...

.... libraries\HCDisplay/HCDisplay.h:63:3: error: #error "No display defined!"
63 | #error "No display defined!"
| ^~~~~

You need to tell the library which display you are using by uncommenting it in the options.h file.

To do this, locate the HCDisplay library folder. If you are using Windows this should be located in My Documents\Arduino\libraries\ folder.

Inside the HCDisplay folder you should find the Options.h file. Open this in a text editor. Note that if you're using Windows, don't use the built-in windows notepad as it gets the formatting wrong. Instead use something like notepad++.

In the Options.h file make sure that all the display options are commented out (with a //) except the one for your display. For your display the file should then look like this:


  1. #define ST7920                              //12864 128x64 Pixel Graphic Display module ST7920 Controller (HCMODU0032)
  2. //#define ILI9325_SHIELD                        //2.4 Inch TFT shield (SKU: HCARDU0108)
  3. //#define ILI9327_SHIELD                            //3.2 Inch TFT shield (SKU: HCARDU0111)
  4. //#define HX8352B_SHIELD                        //3.2 Inch TFT shield (SKU: HCARDU0109)
  5. //#define ILI9341_SPI_WITH_TSC2046_TOUCH_SENSOR //2.4 & 3.2 inch TFT LCD Module with Touch Panel ILI9341 (HCMODU0133 & HCMODU0132)
  6. //#define MAX7219_DOT_MATRIX                    //8x8 Serial Dot Matrix Modules (HCOPTO0014 & HCMODU0135)
  7. //#define HCMODU0136_HT1621                     //HT1621 6 Digit 7 Segment LCD Module - Green Backlight (SKU: HCMODU0136)
  8.  
  9.  
  10. #include "Fonts/MedProp_12pt.h"
  11. #include "Fonts/LargeProp_26pt.h"
  12. #include "Fonts/LCDLarge_24pt.h"
  13. #include "Fonts/LCDLarge_52pt.h"
  14. #include "Fonts/NarrowProp24pt.h"

Whilst you're editing the file you can also comment out any fonts you're not using to save some program memory.

Once you have edited the file save it and then try compiling your sketch again.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “Arduino”