Here it is 🙂
RA8875 Custom Font
Awesome! One question – how do you specify the x-y position to draw the font at?
Its in the lcd code .. thats normal stuff…
////////////////Text write position
void FontWrite_Position(uint X,uint Y)
unsigned char temp;
I must be thick… If I want to render the letter “A” in my custom font (assuming I already created the bitmap for “A” in my C code) at position 221x 115y, what would the code sequence look like?
// how do I tell it to actually draw the loaded font charter here?
Hah i guess i should add that to the PDF… ASCII is simple enough most drawable characters are from 32 to 126 aka SPACE to ~ …
To make it simple you can draw the letter A (capital) in its position which is 65.
Write_Dir(0x40,0x80);//Set the character mode
Write_Dir(0x21,0x80);//Select the internal CGRAM
If you are just loading a symbol such as the BATTERY symbol then keeping it in place doesnt matter. So you can start at 0 like:
You rock! This is exactly what I was looking for.
Last one – font size/scale. By default, they’re 8×16. What if I wanted 2x, 3x, etc? I thinks there’s another LCD command for this, or would/could we define a larger custom font array?
Thats what i plan to look into next. I have some 16×16 fonts i would love to try. There are only 255 spots in the font available so larger fonts will be shortened to less characters.
I updated the PDF and im glad this helped!
I’m guessing that font scaling would probably not look so great, and would probably be better of just drawing a pre-scaled bitmap for large sizes.
yeah, or you can draw it on a few font positions and then line them up .. it shows it in the PDF as a image
Was looking at your git code again, and I don’t see where you actually draw your buttons on the LCD. I see the Init code that sets position, but don’t see where you actually draw them? Are you just rendering one big static BMP and then mapping touch locations that correspond with areas in the BMP?
I actually do both. The volume and channels are drawn individually as they have 3 states. The other buttons are 1 large image and individual sections are drawn based on touch. Check the ta8875.c file for openasi.. asi is my own custom file type
The .asi files are on the SD card wired to the mcu?
Why do you need to do an SPI__WRITE(0) before each row of 16-bit color data? I don’t see that in the spec?
Not sure if you are talking about the asi functions of so that’s to set the mode to write data since I dont use rw or rs pins.
Yeah. Couldn’t it just be sent once per entire image byte array, rather than for each pixel row?
possibly if the image is tiny. Im using SPI for SD also so i have to deselect the chip and im not sure if it looses that state. So i just resend it.
how can I apply this in Arduino? per exemple
I havent used this with Arduino, sorry. But it shouldnt be to hard to implement it. The code should be almost copy and paste-able. Do you have arduino code made for the LCD already? I can add my code to it for you.
Hi Jason, Very nice.
1) Where did you order this TFT from?
2) How many pins does it consume to run properly (40, 50) ?
Hey buddy! I got the screen from : http://www.buydisplay.com/default/7-inch-lcd-module-capacitive-touch-screen-panel-i2c-spi-serial.html
It uses SPI/I2C/Parallel interface, Depends on which one you use. If SPI.. Then 4 SPI lines… If you get the Capacitive Touch version like me then you will also need I2C for the touch screen. It doesnt use 40-50 lines.
Check this out: (MCU they chose is the STC12LE5A60S2)
Please log in using one of these methods to post your comment:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Notify me of new posts via email.