Shop OBEX P1 Docs P2 Docs Learn Events
Large numerals with TV_WText — Parallax Forums

Large numerals with TV_WText

As part of a home built ATV project I'd like to install a 'GLASS PANEL". Something like the instrument panel on newer cars. This would have several temperature readouts, a numeral style clock and multiple other info displayed. What I'm now trying to do is put the digital speedometer in the center of the screen but in large digits. I've figured out how to display the large digits using TV_WText windows but am hoping there is a way to maybe put the 10 digits in a DAT block so they could be displayed as needed and easily called with a minimum of code. I pretty sure this is easily done but at the moment I am stumped as to how to go about it. I haven't use DAT memory for any but simple strings etc.

Here is what I've come up with to display a big numeral 2. Only 9 digits to go but how to make it easy I don't know.
CON

  _clkmode      = xtal1 + pll16x
  _xinfreq      = 5_000_000
  basepin       = 0

  CLS           = $00  'clear screen
  HOME          = $01  'home
  CRSRXY        = $02  'set X, Y position (X, Y follow)
  CRSRLF        = $03  'cursor left
  CRSRRT        = $04  'cursor right
  CRSRUP        = $05  'cursor up
  CRSRDN        = $06  'cursor dn
  USECLR        = $07  'use color C (C follows)
  BS            = $08  'backspace
  TAB           = $09  'tab (8 spaces per)
  LF            = $0A  'linefeed
  CLREOL        = $0B  'clear to end of line
  CLRDN         = $0C  'clear down (to end of window)
  CR            = $0D  'return
  CRSRX         = $0E  'set X position (X follows)
  CRSRY         = $0F  'set Y position (Y follows)
  DEFWIN        = $10  'define window  W (W, Left, Top, nCols, nRows follow)
  USEWIN        = $11  'use window W (W follows)
  DEFCLR        = $12  'define color C (C, FG, BG follow)
  SCRLLF        = $13  'scroll window left
  SCRLRT        = $14  'scroll window right
  SCRLUP        = $15  'scroll window up
  SCRLDN        = $16  'scroll window down
  CHGCLR        = $17  'change all colors in window to C (C follows)
  SHOSCR        = $19  'copy display buffer to screen buffer.
  CLRW          = $1E  'same as CLR, but can be used in strings.
  ESC           = $1F  'escape next character C (i.e. print as-is) (C follows)
  ZERO          = $FF  'can be used for 0, which is not allowed in strings, for command arguments

OBJ

  pr : "tv_wtext_db"

PUB start 
                            
  pr.start(basepin)

                 '(W, Left, Top, nCols, nRows)
    'This displays a number 2 with windows. It is 4 digits wide by 5 digits high
  pr.str(string(DEFWIN, 1, 15, 4, 4, 1, USEWIN, 1, CHGCLR, 11))    'top of 2  
  pr.str(string(DEFWIN, 2, 18, 5, 1, 1, USEWIN, 2, CHGCLR, 11))    'rt vert of 2
  pr.str(string(DEFWIN, 3, 15, 6, 4, 1, USEWIN, 3, CHGCLR, 11))    'mid hori of 2
  pr.str(string(DEFWIN, 4, 15, 7, 1, 1, USEWIN, 4, CHGCLR, 11))    'lf vert of 2
  pr.str(string(DEFWIN, 5, 15, 8, 4, 1, USEWIN, 5, CHGCLR, 11))    'bot of 2

  
  
  pr.str(string(SHOSCR, USEWIN))

 

Thanks
Aaron
Sign In or Register to comment.