|
Post by salman on Feb 16, 2014 6:37:10 GMT -8
Following the manual, I tried to compile a program from the text but get compile errors. Not sure where NIGHTFONT_HANDLE is supposed to come from...the documentation is pretty vague at times on how to proceed with the examples...perhaps I need to dig into all the underlying code (GD2.h and GD2.cpp) to figure these things out. Salman #include <EEPROM.h> #include <SPI.h> #include <GD2.h> void setup() { GD.begin(); } void loop() { byte font = NIGHTFONT_HANDLE; GD.cmd_text(240, 40, font, OPT_CENTER, "abcdefghijklm"); GD.cmd_text(240, 100, font, OPT_CENTER, "nopqrstuvwxyz"); GD.cmd_text(240, 160, font, OPT_CENTER, "ABCDEFGHIJKLM"); GD.cmd_text(240, 220, font, OPT_CENTER, "NOPQRSTUVWXYZ"); }
|
|
bubu
Junior Member
Posts: 17
|
Post by bubu on Feb 17, 2014 0:08:08 GMT -8
Check the top section on page 54 of the book to see what fonts are available for your use by simply giving the number. When you try to use a "NIGTHFONT_HANDLE", you have to create that asset with the gd2asset tool out of an true type font and load it prior to use.
Change your code to: byte font = 31;
That should work.
|
|