HCDisplay Arduino library for Hobby Components Displays

Useful guides, libraries, and example sketches to support our Arduino based products.
Gazz292
Posts: 8
Joined: Wed Jan 06, 2021 8:45 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by Gazz292 » Thu Jan 07, 2021 1:52 pm

Thankyou for the suggestion,

unfortunatley 0x0F is also 'T/t' so it displays a 't' instead of a c,

i tried removing all the letters except the numbers, the dot and the c, but then it refuses to compile,

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by andrew » Thu Jan 07, 2021 3:19 pm

Sorry, try changing it to:

Code: Select all

						0x0E, // c
If that's still wrong I'll check it when I have access to one tomorrow.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Gazz292
Posts: 8
Joined: Wed Jan 06, 2021 8:45 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by Gazz292 » Thu Jan 07, 2021 3:55 pm

Woohoo, thankyou so much, that worked,
The result :
You do not have the required permissions to view the files attached to this post.

Gazz292
Posts: 8
Joined: Wed Jan 06, 2021 8:45 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by Gazz292 » Thu Jan 07, 2021 4:04 pm

So... to allow other people to have the same thing, i'd need to include the changed .h file with the sketch?

i know i could just tell them what to do, but i know that will confuse some people, especially as some don't believe that using word / note pad mangles the code, and notepad++ scares them :)


And finally, i'll need to figure out code to allow minus temps to display but not shift the display one digit to the right,
for now i'm simply using
HCDisplay.Pos(1);
HCDisplay.Print("-10.3c");

And when i display a positive temp i put a space where the - was. but i think that's basic arduino code i need to learn there.

This will be getting the temperature as a plain text from the serial port as part of other strings, so '21.3c' or -14.1c' will be things to expect, oh yeah, i need to allow for the single to double digit thing too here for '9.6c' inputs.

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by andrew » Fri Jan 08, 2021 9:40 am

So... to allow other people to have the same thing, i'd need to include the changed .h file with the sketch?
I'll upload a version (0.2.1) of the library with a lower case 0 to the first post shortly.

And finally, i'll need to figure out code to allow minus temps to display but not shift the display one digit to the right,
This will be getting the temperature as a plain text from the serial port as part of other strings,
If you're handling the strings as character arrays, which is the format the HCDisplay library will need them to be in anyway, you can use the sizeof() function to determine how long the text is. You can then use this value to offset the position of the text when displaying it on the screen. Here is an example of how sizeof() works:

  1. void setup() {
  2.   Serial.begin(9600);
  3.  
  4.   char text[] = "-23.1c";
  5.  
  6.   Serial.print(sizeof(text));
  7. }
  8.  
  9. void loop()
  10. {
  11. }
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Gazz292
Posts: 8
Joined: Wed Jan 06, 2021 8:45 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by Gazz292 » Fri Jan 08, 2021 6:46 pm

Thankyou very much,

The data i get from the simulator is a string of plain text, so the one for interior temperature will be plain text like '21.6c' so the dot and c will always be there, just the numbers and minus symbol if needed i altering, plus the position of the test when it goes to single digit temps.

So it's easiest if i just send that text to the HC display, very handy as that is what it expects :)

geminiman1950
Posts: 2
Joined: Sat Apr 03, 2021 6:17 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by geminiman1950 » Tue Oct 04, 2022 3:10 pm

I cannot find the link to this library, even though I'm logged in. I have the HCARDU0109 display. How do I do this? Thank you.

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by andrew » Tue Oct 04, 2022 3:30 pm

I cannot find the link to this library, even though I'm logged in. I have the HCARDU0109 display. How do I do this? Thank you.

Go to the first post of this forum thread here:

viewtopic.php?p=7132#p7132

At the bottom of the post you'll see the title 'Downloads'. Under that title you'll see a link to a zip file containing the latest (V 0.2.1) version.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

geminiman1950
Posts: 2
Joined: Sat Apr 03, 2021 6:17 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by geminiman1950 » Tue Oct 04, 2022 3:47 pm

Thank you so much, I completely missed that. I was expecting the link to be available when I clicked the heading. Guess, I should go to specsavers. :lol:

DRLDEV
Posts: 1
Joined: Tue Oct 01, 2019 12:42 pm

Re: HCDisplay Arduino library for Hobby Components Displays

Post by DRLDEV » Sun Apr 02, 2023 12:20 pm

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!"
| ^~~~~

The 12864B isn't in the library definitions, and there's no corresponding cpp file.... Have I missed something obvious? Thanks.

#if defined(NOKIA5110)
#include "Nokia_5110.h"
#elif defined(ST7920)
#include "ST7920.h"
#elif defined(ILI9325_SHIELD)
#include "ILI9325_SHIELD.h"
#elif defined(ILI9327_SHIELD)
#include "ILI9327_SHIELD.h"
#elif defined(HX8352B_SHIELD)
#include "HX8352B_Shield.h"
#elif defined(ILI9341_SPI)
#include "ILI9341_SPI.h"
#elif defined(ILI9341_SPI_WITH_TSC2046_TOUCH_SENSOR)
#include "ILI9341_SPI_With_TSC2046_Touch_Sensor.h"
#elif defined(MAX7219_DOT_MATRIX)
#include "MAX7219_Dot_Matrix.h"
#elif defined(HCMODU0136_HT1621)
#include "HCMODU0136_HT1621.h"
#else
#error "No display defined!"
#endif

Post Reply

Return to “Arduino”