the 2.2 board before and after the flash chip added (w25q32bv)
the 2.2 board before and after the flash chip added (w25q32bv)
did a bit more fiddling with the buttons
we now have rounded corners and self centering title text , and self scaling title text size too.
the flash bit now has a flasheader cmd to read image nams and x y sizes .
this demo has the flash bits commented out
ps the button x,y value now is the centre of the button (was bottom lh cnr) and each button can have its own size still
Last edited by richard; - 2nd August 2015 at 10:57.
fixed touch module cs pin not initialised to unselected state on boot up and had some vars being used without being cleared first (real amateur hour stuff)
now with sliders, might try to get the touch module on the spi bus next (should then be able to read touch x,y ps about 16 times faster than bit banging with shiftin )
This is so great work Richard. I believe you will put many here in the temptation to try at least the project.
I am very anxious too, but unfortunately our country is still under capital control and no orders can be placed on ebay etc...
Ioannis
Richard, Seems you've done some fantastic work on using TFT's with PBP.
I have a 2.8" display of the same resolution, but I'm running PBP 2.60c which lacks the usercommand function. Is there any chance you could advise / produce a library that works with version 2.60 ?
I won't speak for Richard but I'd take this as the opportunity you've been looking for to finally justify the upgrade PBP3 - you've now found a feature it has that you want/need ;-)
/Henrik.
I won't say its impossible but
lets take one simple usercmd
macro called isGLCDSTR 2,2,buff
GLCDSTR?CCB macro Xin ,Yin ,Bin
MOVE?CW Xin , _X
MOVE?CW Yin ,_Y
MOVE?CB high Bin, FSR1H ;load highbyte
MOVE?CB low Bin, FSR1L ;load low byte
L?CALL tft_str_out
endm
translation to pbp2.6
not too difficult but its messy and could get very ugly very quickly , as henrik says an upgrade looks goodX=2
Y=2
@ MOVE?CB high _buff, FSR1H ;load highbyte
@ MOVE?CB low _buff, FSR1L ;load low byte
call tft_str_out
Would love to upgrade, but being a casual user, and between jobs, upgrading is simply not an option for me at the monemt
Just found this thread! I like idea very much, and I'd like to contribute, but my programming skills aren't that good. However, I'm way better on graphics, so I can create better looking fonts with chars of different dimensions. Just point me to font file so I can have look how it is organized.
the fonts are really 8x8 fronts but the alpha/numeric char only use 7x8 with the last bit always o (for chr spacing)
there are two fonts in this thread the first is chr 32-90 and the second chr 32-127. I have a extended font (attached) that has
a radio button arrows ,play,stop,pause,speaker on/off symbols ,these use the full 8x8
this is the routine to display font chars
the arduino utft code can handle variable width fonts by storing a second table along with the font . that table records the h/w of every chr in the font and ascii val of the first and last chr in the font too.Code:g cga: g_fontoffset = (g_chr-font_begin)*8 + fontaddr if (x+textsize*7) > width then return if (y+textsize*8) > height then return if (g_chr <font_begin) || (g_chr >font_end ) then return for ROW=0 to 7 ;font height this would need to be a var set to font height size readcode g_fontoffset +ROW,ctemp ;this would need to be able to "unpack" different font with bits for PIXEL=0 to 7 ;font width ; font width var req here too X1= X+PIXEL X0=X1 Y0=Y+7-ROW Y1=Y0 IF TEXTSIZE ==1 THEN GOSUB SETWINDOW if ctemp.0[PIXEL] then ;SETPIXEL X+PIXEL,Y+7-ROW ,FG TFT_CMD_IN= FG>>8 GOSUB TFT_DATA TFT_CMD_IN= FG GOSUB TFT_DATA ELSE ;SETPIXEL X+PIXEL,Y+7-ROW ,BG TFT_CMD_IN= BG>>8 GOSUB TFT_DATA TFT_CMD_IN= BG GOSUB TFT_DATA ENDIF ELSE X0=X+PIXEL*TEXTSIZE Y0=Y+( 7-ROW )*TEXTSIZE X1= TEXTSIZE Y1= TEXTSIZE if ctemp.0[PIXEL] then FrG=fg GOSUB frectc ELSE FrG=BG GOSUB frectc ENDIF ENDIF NEXT next x=x+textsize*7 ;auto increment x for str function ; and font width here too RETURN
its pretty straight forward but not trivial task to change the pgm to do that ; however all the text box code for buttons etc would need to be altered too
Bookmarks