The font I'm using was created using the Font Editor. I'm assuming the Font Editor picks up a list of fonts that are already on the PC. I used the default choice, Microsoft Sans Serif, at 40 pt. Checking with the Windows Character Map tool, I see that this font does in fact have a degree sign.
But that doesn't seem to be the problem. I tried
TempF.setText ("\0x41") ;
(an uppercase "A") and that also failed to print anything. Perhaps setText doesn't handle hex characters?
\0 terminates the string immediately and hence the rest will not really be sent to the display.
That's what I keep telling about the uselessness of \0 in a string literal.
Here’s my latest problem. I used the Nextion editor to set the background to blue. It looks blue in the editor and it compiled OK. But when I download it to the display I get this. The text label backgrounds are correct, but the global background is screwed up. What am I doing wrong now?
I'm not setting any bitmaps. My background is plain default with only a color change, set like this:
What's weird is that if I click in any text box I created, the background looks OK in the editor. But if I click anywhere in the background, it changes to this:
Do you see these on the actual display too?
I’d think this is something you should rather be asking on the ITEAD forum, as this isn’t anything Particle related.
No, what I see on the display is the screenshot above with the rainbow noise background. The vertical white lines are what I see on the PC using the editor's Debug function.
At this point, you're right. This may simply be a consequence of using a program whose version number starts with a zero. Thanks very much for looking at it anyway.
Well after accusing me of hacking their HMI file and then denying it’s an editor bug, I got a solution to this problem from a rather surly individual over at Itead who we’ll just refer to as John Smith. That’s not his real name. (His real name is Patrick Martin).
So for the benefit of anyone still following this thread, here’s what to do:
Create a new page with the + icon in the Page Pane
Go to the offending page, select all components on page
Control-C to copy
Go to the new page created in step 1
Control-V to paste
Delete page0 with the x icon in the Page Pane
Double click page1 to enable editing of page name
rename page1 to page0 and enter to save
Save HMI project and rebuild with the Compile button.
Yup, I had the "honour" of not fully agreeing with him before too.
I might be biased, but I think this community tends and wishes to be a friendlier place
Thanks for reporting back on the "solution" / workaround
Ha ha. It gets better. After Herr Martin’s missive, some churl by the name of Gerry Kropf just had to take a gratuituous shot at me for good measure. Then to guarantee they had the last word, they locked the thread.
In contrast, I have found that in the nearly a year I’ve been here I’ve found everyone to be knowledgable, unfailingly helpful, and downright civilized.
It’s been a long time coming but I finally have the Nextion serial display working with my Photon weather station.
It did have one final trick though. The default baud rate for theSparkfun serial LCD is 115,200. That is also the default for the RN-41 (aka BlueSmirf) Bluetooth module, so all was good. However, Itead inexplicably decided to make the default baud rate for their display to be a pokey 9600, so it won’t work if you just swap it in for the Sparkfun display.
For the benefit of anyone else trying to do this conversion, you have to connect the Nextion directly to the Photon’s Serial1 pins and then issue the following command:
Serial1.print ("bauds=115200\xFF\xFF\xFF") ;
Then connect the Nextion to the RN-41 and it should be able to receive data from it. This command only needs to be done once. The Nextion will remember it across power cycles.
@ScruffR
Finally got around to using the Particle library for this rather than my old, hacked one derived from the original Arduino code. It looks like NexText::setBackColor() is defined in the header file, but missing from the .cpp file. So I just added it to my .ino file as a workaround: