Shop OBEX P1 Docs P2 Docs Learn Events
VFD and BSP2 — Parallax Forums

VFD and BSP2

RobbanRobban Posts: 124
edited 2008-12-05 16:41 in BASIC Stamp
Hi!

I am trying to write big numbers on this VFD...see attached pdf
the program checks a value and then write it in a "mirrored mode" to the display.
i want to write

····· SPEED

······· 123

and the 123 should be with big numbers
but all i get is a bunch of 1:s 2:s 3:s and other fragments.

here is some lines of what i wrote
bigone:
SEROUT 2,240,[noparse][[/noparse] $1A ,$40, $10, Q,Z, $18,$10,$1F,$04,$04,$04,$04,$04,$04,$04,$0C,$04,$00]
return· "return to valuecheck"
bigtwo:
SEROUT 2,240,[noparse][[/noparse] $1A ,$40, $10, Q,Z, $18,$10,$1F,$10,$10,$10,$10,$1F,$01,$01,$01,$1F,$00]
RETURN·· "return to valuecheck"
bigtree:
SEROUT 2,240,[noparse][[/noparse] $1A ,$40, $10, Q,Z, $18,$10,$1E,$01,$01,$01,$01,$0E,$01,$01,$01,$1E,$00]
RETURN·· "return to valuecheck"
anyone who can help?


Post Edited (Robban) : 12/3/2008 11:12:04 AM GMT
pdf
212K
VFD.pdf 211.9K

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-12-03 12:30
    Here, this member·worked out a LCD speedometer with double-size characters, but·they're not backward.· Try his program with your device and then work out re-defining the characters.· (Make sure the timing factors are right for your BS2p, etc.)
  • RobbanRobban Posts: 124
    edited 2008-12-03 12:40
    timing factors?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-03 16:11
    He’s referring to your baud rate value, which appears to be correct for 9600 on a BS2p.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • flying_flipflying_flip Posts: 36
    edited 2008-12-03 19:22
    The program I wrote was for the Parallax LCD 2 x 16, not sure what you would need to do to get it to work on the VFD you have....It looks like All you need to do is put your VFD into 10x14 font size before you print the second line...
    Select Font 1CH / 1DH / 1EH Select font.
    1CH = proportional mini font. 1DH= fixed spaced 5x7 font. 1E = fixed spaced 10x14 font.



    Post Edited (flying_flip) : 12/3/2008 7:28:59 PM GMT
  • RobbanRobban Posts: 124
    edited 2008-12-04 15:51
    flying flip....i am not trying to write the common letters och numbers in the VFD....i want to write letters and numbers in a mirrored way by using the graph function.

    another question....do i have to use the HB and MB lines?
  • RobbanRobban Posts: 124
    edited 2008-12-04 17:53
    Hi!

    I have almopst managed to write in mirrored mode with normal sized letters.
    But when i add numbers the program says....symbol already defiened.
    why? what should i do?


    here´s my program

    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}

    AA VAR Byte
    CHAR VAR Word
    Z VAR Word
    CH VAR Word
    Q VAR Word
    X VAR Byte
    VALUE VAR Word
    NR VAR Byte
    AB VAR Byte

    SEROUT 2,240,[noparse][[/noparse]$19]
    Z=800


    ' MASK OUT ONE FONT
    CX:
    WRITE Z, "HELLO WORLD 123",0
    TESTA:
    DO
    Q=Q+8
    IF Q=8 THEN Q=1
    READ Z, char
    IF char=0 THEN END
    GOSUB MAIN
    Z=Z+1

    LOOP UNTIL (CHAR=0)
    END


    MAIN:

    ' SET THE VFD TO GRAPHIC MODE
    SEROUT 2,240,[noparse][[/noparse]$1a ,$40, $10, Q,$1C, $18, $08]
    LOOKDOWN CHAR,[noparse][[/noparse]" ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","R","S","T","U","V","W","0","1","2","3","4","5","6","7","8","9"],x



    ' EEPROM DATA
    DATA $00,$00,$00,$00,$00,$00,$00,$00
    A DATA $11,$11,$1F,$11,$11,$0A,$04,$00
    B DATA $1E,$11,$11,$1E,$11,$11,$1E,$00
    C DATA $0E,$11,$10,$10,$10,$11,$0E,$00
    D DATA $1E,$11,$11,$11,$11,$11,$1E,$00
    E DATA $1F,$10,$10,$1C,$10,$10,$1F,$00
    F DATA $10,$10,$10,$1C,$10,$10,$1F,$00
    G DATA $0E,$11,$11,$13,$10,$11,$0E,$00
    H DATA $11,$11,$11,$1F,$11,$11,$11,$00
    I DATA $0E,$04,$04,$04,$04,$04,$0E,$00
    J DATA $0C,$12,$02,$02,$02,$02,$07,$00
    K DATA $11,$12,$14,$18,$14,$12,$11,$00
    L DATA $1E,$10,$10,$10,$10,$10,$10,$00
    M DATA $11,$11,$11,$11,$15,$1B,$11,$00
    N DATA $11,$11,$19,$15,$13,$11,$11,$00
    O DATA $0E,$11,$11,$11,$11,$11,$0E,$00
    P DATA $10,$10,$10,$1E,$11,$11,$1E,$00
    R DATA $11,$12,$14,$1E,$11,$11,$1E,$00
    S DATA $0E,$11,$01,$0E,$10,$11,$0E,$00
    T DATA $04,$04,$04,$04,$04,$04,$1F,$00
    U DATA $0E,$11,$11,$11,$11,$11,$11,$00
    V DATA $04,$0A,$11,$11,$11,$11,$11,$00
    W DATA $11,$1B,$15,$11,$11,$11,$11,$00
    1 DATA $0E,$04,$04,$04,$04,$0C,$04,$00
    2 DATA $1F,$08,$04,$02,$01,$11,$0E,$00
    3 DATA $0E,$11,$01,$06,$01,$11,$0E,$00
    4 DATA $02,$02,$1F,$12,$0A,$06,$02,$00
    5 DATA $0E,$11,$01,$0E,$10,$10,$1F,$00
    6 DATA $0E,$11,$11,$1E,$10,$08,$06,$00
    7 DATA $08,$08,$08,$04,$02,$01,$1F,$00
    8 DATA $0E,$11,$11,$0E,$11,$11,$0E,$00
    9 DATA $0E,$11,$01,$0F,$11,$11,$0E,$00


    AB=X*8
    NR=AB+7
    FOR AA=AB TO NR
    READ AA,VALUE
    DEBUG DEC AA, " ",HEX VALUE,CR
    PRINT:
    SEROUT 2,240,[noparse][[/noparse]VALUE]
    NEXT
    EX:

    RETURN
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-12-05 09:51
    Robban -

    The corrected copy is attached. Please use the Attachment Manager, as I have now,·whenever you want to distribute your program. It makes it a whole lot easier than cutting and pasting it so someone can look at it off list. The changes I made appear in my upload of your program, with a minor revision.

    For those who haven't looked at this program, you must follow the rules for forming symbol names, regardless of where those symbol·names may be used in the program. In this case it was easy enough to make such an error, as all the names in·the DATA statements were·following suit with the way the Lookdown statement was written.

    The names of the LETTERS (A-Z) were fine, but when the Stamp syntax checker ran into NUMBERS (the literal constants -·0 thru 9) it choked. I suppose in many other languages you can name anything any way you choose. Somewhat unfortunately the PBASIC language has some (perhaps stern) rules for forming the names for variables, constants, etc. Symbol names must start with a letter (A-Z) or underscore ("_"). Literal constants such as 1, 2, 3 ... are deemed illegal, and thus the reason for the syntax error in this case. Simple enough error to make, under the earlier mentioned circumstances.

    Take home for those new to troubleshooting -

    Usually following suit with symbol names is a good thing, as it adds documentation value. Here it unfortunately cause a syntax error (duplicate symbol defined). Why?··········································································

    I'll leave it to the reader, or anyone who downloads the program to ascertain the why, if it's not obvious.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.
  • RobbanRobban Posts: 124
    edited 2008-12-05 16:41
    thanx bruce! i got it working BUT....when i try to write "789" instead of hello world" all i get is 78.
    i also added a data string for the "0" (zero)

    What is wrong..

    heres the program again.

    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}

    AA VAR Byte
    CHAR VAR Word
    Z VAR Word
    CH VAR Word
    Q VAR Word
    X VAR Byte
    VALUE VAR Word
    NR VAR Byte
    AB VAR Byte

    SEROUT 2,240,[noparse][[/noparse]$19]
    Z=800


    ' MASK OUT ONE FONT
    CX:
    WRITE Z, "789",0
    TESTA:
    DO
    Q=Q+8
    IF Q=8 THEN Q=1
    READ Z, char
    IF char=0 THEN END
    GOSUB MAIN
    Z=Z+1

    LOOP UNTIL (CHAR=0)
    END


    MAIN:

    ' SET THE VFD TO GRAPHIC MODE
    SEROUT 2,240,[noparse][[/noparse]$1a ,$40, $10, Q,$1C, $18, $08]
    LOOKDOWN CHAR,[noparse][[/noparse]" ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","R","S","T","U","V","W","0","1","2","3","4","5","6","7","8","9"],x



    ' EEPROM DATA
    DATA $00,$00,$00,$00,$00,$00,$00,$00
    A DATA $11,$11,$1F,$11,$11,$0A,$04,$00
    B DATA $1E,$11,$11,$1E,$11,$11,$1E,$00
    C DATA $0E,$11,$10,$10,$10,$11,$0E,$00
    D DATA $1E,$11,$11,$11,$11,$11,$1E,$00
    E DATA $1F,$10,$10,$1C,$10,$10,$1F,$00
    F DATA $10,$10,$10,$1C,$10,$10,$1F,$00
    G DATA $0E,$11,$11,$13,$10,$11,$0E,$00
    H DATA $11,$11,$11,$1F,$11,$11,$11,$00
    I DATA $0E,$04,$04,$04,$04,$04,$0E,$00
    J DATA $0C,$12,$02,$02,$02,$02,$07,$00
    K DATA $11,$12,$14,$18,$14,$12,$11,$00
    L DATA $1E,$10,$10,$10,$10,$10,$10,$00
    M DATA $11,$11,$11,$11,$15,$1B,$11,$00
    N DATA $11,$11,$19,$15,$13,$11,$11,$00
    O DATA $0E,$11,$11,$11,$11,$11,$0E,$00
    P DATA $10,$10,$10,$1E,$11,$11,$1E,$00
    R DATA $11,$12,$14,$1E,$11,$11,$1E,$00
    S DATA $0E,$11,$01,$0E,$10,$11,$0E,$00
    T DATA $04,$04,$04,$04,$04,$04,$1F,$00
    U DATA $0E,$11,$11,$11,$11,$11,$11,$00
    V DATA $04,$0A,$11,$11,$11,$11,$11,$00
    W DATA $11,$1B,$15,$11,$11,$11,$11,$00
    num0 DATA $0E,$11,$11,$11,$11,$11,$0E,$00
    NUM1 DATA $0E,$04,$04,$04,$04,$0C,$04,$00
    NUM2 DATA $1F,$08,$04,$02,$01,$11,$0E,$00
    NUM3 DATA $0E,$11,$01,$06,$01,$11,$0E,$00
    NUM4 DATA $02,$02,$1F,$12,$0A,$06,$02,$00
    NUM5 DATA $0E,$11,$01,$0E,$10,$10,$1F,$00
    NUM6 DATA $0E,$11,$11,$1E,$10,$08,$06,$00
    NUM7 DATA $08,$08,$08,$04,$02,$01,$1F,$00
    NUM8 DATA $0E,$11,$11,$0E,$11,$11,$0E,$00
    num9 DATA $0E,$11,$01,$0F,$11,$11,$0E,$00


    AB=X*8
    NR=AB+7
    FOR AA=AB TO NR
    READ AA,VALUE
    DEBUG DEC AA, " ",HEX VALUE,CR
    PRINT:
    SEROUT 2,240,[noparse][[/noparse]VALUE]
    NEXT
    EX:

    RETURN
Sign In or Register to comment.