Shop OBEX P1 Docs P2 Docs Learn Events
TV Broadcast using TV_Text - Page 3 — Parallax Forums

TV Broadcast using TV_Text

13»

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-06-11 20:40
    Use the setcolors command and pass it a pointer to a top level DAT block with your own colors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2007-06-11 22:09
    Paul, I wrote:

    Pub Main

    · repeat
    ··· SetXY(0,0)···· 'column, row
    ··· term.str(string("······ Propeller Broadcast", CR))
    ··· setxy(0,1)
    ··· term.setcolors(7)··
    ··· term.str(string("· Enter your text:",13,13))
    ··· repeat until (c := kb.getkey) == "*"
    ····· term.out(c)
    ··· start···

    I assumed the setcolor pointer - 7 - would point to Line 7 of the DAT/palette and that it would change only the color of the second line of text.· Instead, it changed the whole display to brown on yellow, which is not even shown in the palette list.· What am I doing wrong?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-06-11 22:18
    Sid, replace your redline with:

    term.out($0C)
    term.out(7)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2007-06-11 22:35
    That's what I was looking for Paul - it works beautifully!· How would I have known that if you hadn't told me?· I could find no references to $0C.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-06-11 22:44
    Its in the comments for the function out. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2007-06-11 23:40
    Paul, I presume you are referring to the comments under tv_colors.· I read that section several times and I still don't understand tghe derivation of $0C.· It's not important - I am just curious.· Like I say, I really don't have to know how things work - just how to use them.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-06-11 23:55
    No the function "out" starting on line 114, the comment section is this:

    '' Output a character
    ''
    ''     $00 = clear screen
    ''     $01 = home
    ''     $08 = backspace
    ''     $09 = tab (8 spaces per)
    ''     $0A = set X position (X follows)
    ''     $0B = set Y position (Y follows)
    ''     $0C = set color (color follows)
    ''     $0D = return
    ''  others = printable characters
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2007-06-12 00:07
    I was so busy looking at the forest, I didn't see the trees.· This'll teach me!· Thanks, Paul.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2007-06-12 16:25
    Paul, I think there is an error in broadcast_test.· I could not get SetXY to work, and when I tried to enter text, I always had to hit the first key of a line twice.· After about four hours of trying everything and restudying the program I made the following changes to the SetXY method:
    PUB SetXY(x, y)
    · ' This needs to be moved to the TV_Text wrapper, placed here·for·········· compatability for existing object
    · term.out($B)····················· ' set X position (X follows)
    · term.out(x)
    ··
    · term.out($A)······ 'was $B······· ' set Y position (Y follows)
    · term.out(y)
    Now everything works perfectly.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2007-06-12 19:23
    Tom, I have modified the broadcast_test TV program so that you can set different colors for the text lines in the program, enter text from a keyboard, and change the color of the text you are entering "on-the-fly".

    I'll post a copy if you are interested.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • tatatomtatatom Posts: 16
    edited 2007-06-12 21:29
    Newzed that would be great. I really appreciate it and look forward to trying your version. Post away!

    Tom
  • NewzedNewzed Posts: 2,503
    edited 2007-06-12 22:04
    Tom, here is my program and the two objects I am using.· I modified some of the colors in TV_text_Paul so that is why the Rev.A.· You may have to change the keyboard pins - Lines 8 and 74 - and the TV start - Line 5.

    A couple of notes - press Enter to start a new line of text.· The SetXY command is automatically incremented so you don't have to worry about that.· To change the color of a line of text you are entering, press the
    " + " key by the number pad, then press the number of the color you want.· The numbers of the colors are listed at the start of the program.· Be sure you are at the start of a new line before you press +, otherwise it will overwrite the previous line.

    Let me know what you think.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
  • NewzedNewzed Posts: 2,503
    edited 2007-06-13 13:18
    I have been playing around with the colors in tv_text_Paul.· Here is a picture of what I have now.· The TV screen does not photograph very well - the colors are much better than the photo but it will give you an idea.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    525 x 374 - 15K
Sign In or Register to comment.