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,
HCDisplay Arduino library for Hobby Components Displays
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
