HCDisplay Arduino library for Hobby Components Displays
Re: HCDisplay Arduino library for Hobby Components Displays
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,
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,
Re: HCDisplay Arduino library for Hobby Components Displays
Sorry, try changing it to:
If that's still wrong I'll check it when I have access to one tomorrow.
Code: Select all
0x0E, // c
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.
Re: HCDisplay Arduino library for Hobby Components Displays
Woohoo, thankyou so much, that worked,
The result :
The result :
You do not have the required permissions to view the files attached to this post.
Re: HCDisplay Arduino library for Hobby Components Displays
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.
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.
Re: HCDisplay Arduino library for Hobby Components Displays
I'll upload a version (0.2.1) of the library with a lower case 0 to the first post shortly.So... to allow other people to have the same thing, i'd need to include the changed .h file with the sketch?
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,
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:This will be getting the temperature as a plain text from the serial port as part of other strings,
- void setup() {
- Serial.begin(9600);
- char text[] = "-23.1c";
- Serial.print(sizeof(text));
- }
- void loop()
- {
- }
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.
Re: HCDisplay Arduino library for Hobby Components Displays
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
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
-
- Posts: 2
- Joined: Sat Apr 03, 2021 6:17 pm
Re: HCDisplay Arduino library for Hobby Components Displays
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.
Re: HCDisplay Arduino library for Hobby Components Displays
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.
-
- Posts: 2
- Joined: Sat Apr 03, 2021 6:17 pm
Re: HCDisplay Arduino library for Hobby Components Displays
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.
Re: HCDisplay Arduino library for Hobby Components Displays
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
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