Shop OBEX P1 Docs P2 Docs Learn Events
Positioning Cursor on TV — Parallax Forums

Positioning Cursor on TV

MikeSMikeS Posts: 131
edited 2009-03-11 22:32 in Propeller 1
I just finished putting together my first Propeller spin program. It displays the output of the PING on a TV. My question is how do you position the cursor on a TV?
I want to continually monitor the PING but want the output to remain on the same line of the TV screen. As I have it now I get subsequent repeating lines down the screen.
I tried to attach (upload) the program to this post but I kept getting an error.
Thanks,
MikeS

''Ping_TV.spin
''Ping module distance displayed on TV
''started 3/12/09 Mike Stephens
CON

_clkmode = xtal1 + pll8x
_xinfreq = 10_000_000 ''SpinStamp
PING_Pin = 0
CR = 13
VAR
long range

OBJ

term : "TV_Terminal"
ping : "ping"


PUB start | i

'start the tv terminal
term.start(12)
repeat

term.str(@title) 'print a string
range := ping.Inches(PING_Pin) 'get range
term.dec(range) 'print decimal range
term.str(@title1) 'put a string
waitcnt(clkfreq / 10 + cnt) ' Pause 1/10 Second


DAT

title byte "Distance to target ",0
title1 byte" Inches",CR,0

Comments

  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-03-11 22:22
    text.str(string(1,$b,5))
    text.dec(abc)

    would put abc at row 6

    the 1 resets the start position

    more info can be found within the tv text object.
  • CassLanCassLan Posts: 586
    edited 2009-03-11 22:25
    Hi Mike,

    Your better off using TV_Text if you want to position Text at a specific place on screen.

    TV_Terminal as far as I know will only bring the cursor back to the home position (upper left).

    The command for that is:
    term.out($00)

    If you click "Documentation" when you have any of these pre-written drivers open in the Prop Tool, there is usually some desription of how to do stuff.

    Rick

    Also you can print strings on the screen like:
    term.str(String("Hello"))

    you dont have to have it in a DAT block

    Post Edited (CassLan) : 3/11/2009 10:31:25 PM GMT
  • MikeSMikeS Posts: 131
    edited 2009-03-11 22:32
    Erik,
    Thanks for the help, I found the syntax in the TV_Text file.
    MikeS

    Thanks CassLan,
    I really appreciate your help
    MikeS
Sign In or Register to comment.