Shop OBEX P1 Docs P2 Docs Learn Events
PTP2 With the QT Board it's amazing but also its to big for my........ HELP — Parallax Forums

PTP2 With the QT Board it's amazing but also its to big for my........ HELP

jvrproductionsjvrproductions Posts: 61
edited 2012-01-29 12:59 in Propeller 1
Hello all and thanks for reading. Well i just start on this world of the propeller 3 months ago and now i have this amazing screen that it's killing me :-)

So far a was able to Write text on the LCD, change the background color, the text color and print a bitmap.
If i understood correctly, the lcd (or the driver) have 300 tiles on each one i can use 2 colors. Some one may PLEASE point me to where i can learn how to send data to each tile? I dont want video or any type of movement at this time i just one to fill pixels on specific colors and spaces of each tile...

Thanks a lot for any help

Comments

  • RaymanRayman Posts: 14,845
    edited 2012-01-28 04:46
    The 3.5" and 4.3" drivers are really just slightly different versions of the VGA driver.
    Basically, the same capabilities and limitations are there although the resolution is fixed.

    It sounds like you want to do graphics... One way to do that is with the Graphics.spin object.
    Look at the PTP2 paint example to see how to use it.

    Another way is to come up with custom tiles. I have 2-bit and 1-bit custom tile generators:
    http://www.rayslogic.com/propeller/Programming/2BitBitmap.htm

    One other experimental way is to use external memory to hold the video buffer.
    That is something I'm working on (slowly) with my Flashpoint memory modules...
  • RaymanRayman Posts: 14,845
    edited 2012-01-28 06:43
    BTW: Thanks for the positive feedback about that Quickstart version of PTP2...
    That is actually the first one of a test batch that you have.
    I was on the fence about doing a production run, but now I think I will...
  • jvrproductionsjvrproductions Posts: 61
    edited 2012-01-28 07:57
    Rayman may you give me a hand here please. I am trying to use the Prop2Bitbitmap may you give me an working clean example please. Can be the same logo that is on your application but i am to new for this...... and i can't make to work. thanks
  • RaymanRayman Posts: 14,845
    edited 2012-01-28 08:15
    Ok, PTP2 Paint is a good example of using 1 and 2 bit bitmaps.

    It is a little complex, but I think you can do it.

    You can use the Prop2BitBitmap to create a .dat file with your bitmap.
    Add it with the others between "UserCharStart" and "UserCharEnd" in the DAT 'Bitmap Data section.
    draw it on the screen using the Bitmap2Bit function.

    If you can't figure it out, let me know and I'll give you that "clean" example...
  • jvrproductionsjvrproductions Posts: 61
    edited 2012-01-28 08:29
    Sorry. went i say clean it's that show only that part (only the necessary code to show the logo or to show one tile). It's no related to your code... :-) It's my bad English sorry....
  • RaymanRayman Posts: 14,845
    edited 2012-01-28 09:30
    Yes, that's what I meant too by "clean". PTP2 paint has a lot of stuff in it, perhaps making it difficult to seperate out the 2-bit bitmap part...
  • jvrproductionsjvrproductions Posts: 61
    edited 2012-01-28 10:16
    Almost there..... :-) If i make this work i will upload the "Clean file with only what its necessary to use the Bitmap data....



    almost.jpg
    449 x 800 - 21K
  • jvrproductionsjvrproductions Posts: 61
    edited 2012-01-28 13:10
    IMAG0353.jpg
    Starting.......
    1024 x 1823 - 67K
  • RaymanRayman Posts: 14,845
    edited 2012-01-28 13:17
    Nice. I'm glad to see you were able to going without too much help.
  • jvrproductionsjvrproductions Posts: 61
    edited 2012-01-29 08:26
    Thanks Rayman. The screen it's now working very good. I think that if i was able to used with my very short experience on micro-controllers and first time user of this type of lcd... Anyone will be available to use :-). Up today i was able to put 4 colors bitmaps, texts, update the info on the screen on real time and use the touchscreen interface. :-). i am stock on two think only (as today :-)) and hope you or any one may help me....

    1- i and getting the colors from the lcd driver where for example:
    White=       %11<<6+%111<<3+%111
    
    where %11blue, %111green and %111red bits white it's easy and black its easy to because will be all 0's instead of 1's but if i want to create and specific color, from where i can get the bits numbers?

    2- I am trying to understood the Schematic http://www.rayslogic.com/Propeller/Products/PTP2/PTP2_Sched1.png in order to know what pin are un-used but if i read correctly there are no un-used pins?

    Thanks for any help...
  • RaymanRayman Posts: 14,845
    edited 2012-01-29 09:12
    Ok, the colors are slightly different from VGA and PTP1 because I've added an extra bit for both red and green...
    Anyway, some colors are predefined in the PTP2_LcdDriver object:

    CON  'Define some colors
                  '%bb    %ggg    %rrr  'blue, green and red bits
      White=       %11<<6+%111<<3+%111
      DarkBlue =   %01<<6+%000<<3+%000
      DarkCyan =   %11<<6+%001<<3+%010
      Black =      %00<<6+%000<<3+%000
      Red =        %00<<6+%000<<3+%111
      Green =      %00<<6+%111<<3+%000
      Yellow =     %00<<6+%111<<3+%111
      DarkRed =    %00<<6+%000<<3+%010
      Cyan =       %11<<6+%000<<3+%111
      DarkGreen =  %00<<6+%010<<3+%000
    

    So, it's just a binary number here 0..3 for blue and 0..7 for red and green that are just shifted and added up.
  • RaymanRayman Posts: 14,845
    edited 2012-01-29 09:13
    The PTP2 uses less pins than PTP1. It only uses P16..P29. So, P0..P15 and P30&31 are free.
  • jvrproductionsjvrproductions Posts: 61
    edited 2012-01-29 09:19
    Thanks Rayman but i still Don't understood about the colors. Are there any Application, or reference on how to convert the colors? For example your aplication Prop2bitBitmap (By the way VERY easy to use and friendly) you pick the for colors that you will use. How i can convert this colors in order to show correctly the image?
  • RaymanRayman Posts: 14,845
    edited 2012-01-29 10:16
    Ok, I see what you want now...

    The Prop2BitBitmap tool doesn't assign colors, just a number in the range 0..3 to each color.

    The LCD driver (just like TV and VGA) uses an array of 64 colors set. Each set is a long with 4 byte values in it.
    Anyway, you need to create the color set and move it to the colors array...

    For the PTP2 Paint example, I've provided a more easy way to do this with the SetGraphicsColor function:
    'Set Graphics Colors
      '#16=drawing color:  white,red,green,black
      SetGraphicsColor(16,lcd#White,lcd#Red,lcd#Green,lcd#Black)
      '#21=fill screen icon: white,blue,purple,blue
      SetGraphicsColor(21,lcd#White,lcd#DarkBlue,lcd#DarkCyan,lcd#DarkBlue)
      '#22=clear screen icon: black,blue,purple,blue
      SetGraphicsColor(22,lcd#Black,lcd#DarkBlue,lcd#DarkCyan,lcd#DarkBlue)
    

    Here you see I'm creating color set #16 with colors white, red, green and black.
    If these were the colors you want, you then just use the Bitmap2Bit function with 16 for the color.
  • jvrproductionsjvrproductions Posts: 61
    edited 2012-01-29 10:27
    I Really need to have better English.... I am already using that but i want to do for example a new one with a new color that its not on the LCDDriver i want to create a DarkCyan2 that its darker that the one on the CON. In order for me to do that i will put on the LCDDriver a new color "DarkCyan2 = %??<<6+%???<<3+%???" I already have the color that i want on the computer on cmyk or rgb format but i need to convert that format to the ? symbols that its on the code.
  • RaymanRayman Posts: 14,845
    edited 2012-01-29 12:59
    Ok, this is 8-bit color, so there are 256 possible colors. This is better than the 64 of PTP1 and VGA, but nowhere near the 24 bits you can get on a PC...

    If you have a 24-bit color from a PC then you have 8 bits of red, blue and green with each in the range from 0 to 255.
    You can use the RGB function of the PTP2_LcdDriver to convert this color to the nearest equivalent for PTP2.
Sign In or Register to comment.