NHD-7.0-800480EF-ASXN
Hello,
Could you help me, please. I use TFT NHD-7.0-800480EF-ASXN, how can I create a button, import the images?
Best regards,
-
Hi Alexander,
Can you please describe your setup a little more, Which mcu are you using. Does it support 24-bit or 16-bit RGB control?
as far as importing images, you will have to have them on your MCU in a storage format or completely convert the image to hex (https://javl.github.io/image2cpp/) and code in a interpreter, this would occupy the first layer of the Frame Buffer on the display.You can then code in the buttons wherever you want with simple code or use libraries that have pre made buttons, these will occupy the second layer of the framebuffer on the display.
please let me know if this helps. If you can provide more specifics like how you want to handle images, sd card or hard-coded, the MCU or dev board you are using and some of the perifrials, I might be able to supply a little more insight on which direction to take.
Thank you for reaching out!
0 -
Thank you for your answer, I use NXP S32K148. For example, just for the buttons, how can I create with the different dimension, choose the place of buttons, choose the background of buttons?
0 -
Hi Alexander,
Unfortunately your NXP S32K148 is not setup to handle the 24/16bit RGB display natively, you will need an interface board to make sure that you can send the correct signals, which must be parallel 8080.
(https://newhavendisplay.com/controller-board-for-4-3-tft-displays-34-pin-ffc-16-bit-parallel/)
after you have the communication working with the NXP to the interface board then to the display you can start streaming commands and image data.
here is some sample pseduo code
void draw_button(int x, int y, int width, int height, uint16_t bgColor, const char* label) {
// Draw the button background
draw_rectangle(x, y, width, height, bgColor);
// Draw the button label (centered)
draw_text(x + (width / 2), y + (height / 2), label, TEXT_COLOR);
}
void handle_touch(int touchX, int touchY) {
if (touchX >= buttonX && touchX <= (buttonX + buttonWidth) &&
touchY >= buttonY && touchY <= (buttonY + buttonHeight)) {
// Button was pressed, perform action
on_button_press();
}
}
const uint16_t myImage[] = { /* Hex data for the image */ };
void draw_image(int x, int y) {
display.drawBitmap(x, y, myImage, imageWidth, imageHeight, imageColor);
}
void draw_button_with_image(int x, int y, const uint16_t* image, const char* label) {
draw_image(x, y, image);
draw_text(x + (imageWidth / 2), y + (imageHeight / 2), label, TEXT_COLOR);
}
please let me know if this helps to clarify anything.0 -
Yes, it's very helpful, can you have the library for create buttons, lines etc?
0 -
Hi Alexander,
The libraries below should contain what you are looking for and are compatible.
uGFX (https://ugfx.io/)
LittleGL (https://lvgl.io/)
Adafruit GFX Library (https://github.com/adafruit/Adafruit-GFX-Library)
STemWin (https://www.st.com/en/partner-products-and-services/segger-emwin.html)
Image2CPP (https://javl.github.io/image2cpp/) useful tool to convert images to code
Brilliant Graphics from Embedded Wizard (https://www.embedded-wizard.de/platforms/nxp/i-mx-7)
0 -
Thank you, very much for your support.
0
Please sign in to leave a comment.
Comments
6 comments