Positioning Cursor on TV
MikeS
Posts: 131
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
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
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.
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
Thanks for the help, I found the syntax in the TV_Text file.
MikeS
Thanks CassLan,
I really appreciate your help
MikeS