Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestive change.... #1

Closed
tbillion opened this issue Aug 16, 2022 · 10 comments
Closed

suggestive change.... #1

tbillion opened this issue Aug 16, 2022 · 10 comments

Comments

@tbillion
Copy link

While this library was created for Adafruit_ILI9341 drivers, the library can be adapted to other display drivers. Note the driver must use the Adafruit_GFX libraries. To allow other display drivers, modify the lines in the .h and .cpp files to allow a different driver to be passed in. For example change call such as SliderH(ILI9341_t3 *disp,... to SliderH(Adafruit_RA8875 *disp,... and in the .cpp files you may have to change how fonts are passed in using either setFont(&SomeFont) or setFont(SomeFont) 

firstly i love your work! you have the absolute best tft graphing and charting work i have seen for the micro controller classes, and i really do above all else appreciate how much time and effort you have put into this.

as for this menu thing, it is a serious piece of art.

i have been trying to port it to the more general TFT_eSPI(bodmer), which with other codes you have has been a great success,however with this one there is an issue pertaining to fonts, i have tried several font formats and i keep getting one of two errors.

invalid conversion from 'const GFXfont*' to 'int' [-fpermissive]  

and

invalid conversion from 'uint8_t' to 'int' [-fpermissive]

i have tried about 30 fonts, between the ones availble online and the ones available from generators and even the ones that are available with the ili t3 library, im not sure if it is something i am doing or ...

it seems to halt here:

// easy way to include fonts but change globally
#define FONT_SMALL  Arial_12_Bold        // font for menus
#define FONT_ITEM   Arial_16             // font for menus
#define FONT_TITLE  Arial_24_Bold        // font for all headings

thanks for your time

@jaksatomovic
Copy link

did you manage to port it to tft espi?

@KrisKasprzak
Copy link
Owner

I don't have immediate plans on supporting this library.

@KrisKasprzak
Copy link
Owner

If you are trying to port this lib to an adafruit based font's need to be passed by reference (use the & before the font name)

@tbillion
Copy link
Author

tbillion commented Oct 14, 2022 via email

@jaksatomovic
Copy link

Amazing! Could you and would you share the code maybe?

@tbillion
Copy link
Author

tbillion commented Oct 15, 2022 via email

@jaksatomovic
Copy link

Great! Thx a lot!

@jaksatomovic
Copy link

@tbillion looking forward to see the code..thx

@tbillion
Copy link
Author

ILI9341_t3_Menu-mainmodded.zip

sorry @jaksatomovic been a busy few weeks, and ended up getting a new laptop during the last cycle so i had to move and sort everything back out. here is the library that i have modified to work with @bodmers tft_espi. @KrisKasprzak might want to verify that i have done it to his standards because he is a pretty outstanding coder, it really just hacked out the ili and inserted the tft. it does work here works really well, but results may vary in different environments.

@KrisKasprzak
Copy link
Owner

I took a look at the code, and making it work for other display libs was done correctly. Replacing the data type is correct and how I suggest in the readme. Well done.

Basically change every instance of one library data type to another
EditMenu(Adafruit_ILI9341 *Display,bool EnableTouch = false);
to
EditMenu(YOUR_DISPLAY_LIB_TYPE *Display,bool EnableTouch = false);

TIP for future display library adaptions: Depending on the way the display library handles setting fonts you may or may not need to make code changes (passing by ref with the &)--and these changes will be throughout the .cpp and .h files. For this reason I was not able to use a template approach to make the code easier to use with other libs.

Implementation for Teensy library (ILI9341_t3) is:
d->setFont(titlef);

Implementation for Adafruit (and I suspect many others) is:
d->setFont(&titlef);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants