A tft addin for pbp3


Results 1 to 40 of 142

Threaded View

  1. #11
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Any help or suggestions appreciated.
    most of the addin's have user-commands. in the include file where the commands are declared there are comments on how to use them

    eg in touch_tft

    Code:
    ;work around fact that  usercommand won't accept a 1 chr string (thinks its a const)  so leading space is ignored  in button title
        USERCOMMAND "DRAWBUTTON"    ; BTN    { BUTTON NUMBER }
        USERCOMMAND "MAKEBUTTON"    ; X,Y ,BTN,{w},{h} ,"title" [(XY IS button centre)  BUTTON  number  ,   BUTTON size  WILL BE default_button_size IF SIZE OMITTED h=w if h omitted]
        USERCOMMAND "DRAWSLIDER"    ; SLIDER    { SLIDER NUMBER  }
        USERCOMMAND "MAKESLIDER"    ; X,Y {W,H},SLIDER   [(XY IS LHBottom CNR ) SLIDER number    size  WILL BE default  IF W,H OMITTED
    x, y are cartesian coordinates for the screen position of the desired object , it goes without saying that x is horizontal axis [width] y vertical axis [height] when facing screen. both x and y need to be on the screen, objects can also have a width [w] and a height [h] and it follows that
    x+w should still be on the screen as well as with y+h

    if your objects don't fit on the screen then things won't play nice


    start here
    which of these fit on a screen 160x128 ?

    MAKEBUTTON 53,170,0,92 ,40,"Clear" ;
    MAKEBUTTON 276,220,1,56,30,"Sleep"
    MAKEBUTTON 280,150,2,60,"Led"
    MAKEBUTTON 242,52,3,40 ; no text SEE BELOW FOR Another way to attach text
    MAKEBUTTON 140,150,4,50,30," +"
    MAKEBUTTON 205,150,5,50,30," -"

    answer none
    and so on

    I'm really interested in using Portrait mode too
    in chipset driver file you will find this

    Code:
         ;SCREEN ORIENTATION
        TFTDATA $18       ;bit3 controls rgb/bgr  0=bgr , 1 =rgb
                          ;bit2 controls  refresh direction  long  axis
                          ;bit4 controls  refresh direction   short  axis
                          ;bit5 controls portrait/landscape   1=portrait , 0 =landscape  / adjust height width to suit
                          ;bit6 controls  write direction short axis
                          ;bit7 controls  write direction long  axis
    it needs to be setup to match your screen re-orientation and mirror imaging, its no big deal
    you need to set height/width declares to match
    Last edited by richard; - 8th February 2022 at 03:26.
    Warning I'm not a teacher

Similar Threads

  1. Replies: 0
    Last Post: - 25th September 2013, 19:33
  2. code examples / libraries for ILI9320 2.8" TFT LCD Module
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 6th June 2013, 09:50
  3. I really need some help with PBP3
    By Ramius in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th February 2012, 17:05
  4. What's with PBP3?
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th August 2011, 18:09
  5. Experience of driving TFT screens?
    By isaac in forum General
    Replies: 1
    Last Post: - 26th September 2008, 01:15

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts