Shop OBEX P1 Docs P2 Docs Learn Events
MAX7219 Decimal point question — Parallax Forums

MAX7219 Decimal point question

ArchiverArchiver Posts: 46,084
edited 2002-07-02 17:31 in General Discussion
Hi.

I have some difficulties with the Parallax Appkit (using the MAX 7219 LED
Display Driver) for the BS2. I need an easy way to control the decimal point
(SEG DP), to show the digits “12.50”. (Always four digits)

Take the main loop from APPkit program for BS2

Loop:
Gosub MaxDisplay
DispVal=DispVal+1
Goto Loop

Solution?
DispVal can off course not be set to 12.50 so all 4 digits must first be
separated into different variables and then the decimal added to the correct
digit before sending the information to the MAX 7219.

I have been looking into the discussion-history on Max7219 and came across some
info from 22.mars-02 suggesting to add 128 to the variable: dig2=timestr(1)+128

Yea....? It didn’t work for me. (A novice stamper)
I tried everything from DispVal=1+128 to DispVal=Dig2+128. My decimal will not
show up.

OK!

Dig1=1
Dig2=2 ‘ (should have the decimal hare)
Dig3=5
Dig4=0

How should I add the Decimal? (Please help me)
Or is it a setup problem of the MAX 7219? I don’t have a clue.




____________________________________________________________
Win a first-class trip to New Orleans and vacation Elvis Style!.
Enter NOW!
http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes/

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-06-30 00:25
    You might try downloading StampWorks experiment #29 from our web site. You
    can find the explenation in Resources -> StampWorks Experiments and
    downloadable code on the StampWorks catalog page.

    -- Jon Williams
    -- Parallax


    In a message dated 6/29/02 5:45:52 PM Central Daylight Time,
    Stein_Frostad@m... writes:


    > Hi.
    >
    > I have some difficulties with the Parallax Appkit (using the MAX 7219 LED
    > Display Driver) for the BS2. I need an easy way to control the decimal
    > point (SEG DP), to show the digits
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-02 17:31
    This is a part of the code that displays temperature reading from DS1620.

    '* Using The MAX7219 LED Display Driver.

    nonZ = 0
    for index = 5 to 1
    shiftout DATA_n,CLK2,msbfirst,[noparse][[/noparse]index]
    temp = DSdata dig (index-1)
    if temp = 0 then skip1
    nonZ = 1
    skip1:
    if nonZ = 1 OR temp <> 0 OR index = 1 then skip2
    temp = 15
    skip2:
    if index <> 1 then skip3 'Lef decimal point at digit # 1
    temp = temp + 128 'Set Decimal Point (eg 25.5)
    skip3:
    shiftout DATA_n,CLK2,msbfirst,[noparse][[/noparse]temp]
    pulsout Load,5
    next

    goto START
    '************************************************************************


    >From: "xystein frostad" <Stein_Frostad@m...>
    >Reply-To: basicstamps@yahoogroups.com
    >To: "BasicStamp Diskusjon" <basicstamps@yahoogroups.com>
    >Subject: [noparse][[/noparse]basicstamps] MAX7219 Decimal point question
    >Date: Sat, 29 Jun 2002 18:45:05 -0400
    >
    >Hi.
    >
    >I have some difficulties with the Parallax Appkit (using the MAX 7219 LED
    >Display Driver) for the BS2. I need an easy way to control the decimal
    >point (SEG DP), to show the digits “12.50”. (Always four digits)
    >
    >Take the main loop from APPkit program for BS2
    >
    >Loop:
    > Gosub MaxDisplay
    > DispVal=DispVal+1
    >Goto Loop
    >
    >Solution?
    >DispVal can off course not be set to 12.50 so all 4 digits must first be
    >separated into different variables and then the decimal added to the
    >correct digit before sending the information to the MAX 7219.
    >
    >I have been looking into the discussion-history on Max7219 and came across
    >some info from 22.mars-02 suggesting to add 128 to the variable:
    >dig2=timestr(1)+128
    >
    >Yea....? It didn’t work for me. (A novice stamper)
    >I tried everything from DispVal=1+128 to DispVal=Dig2+128. My decimal will
    >not show up.
    >
    >OK!
    >
    >Dig1=1
    >Dig2=2 ‘ (should have the decimal hare)
    >Dig3=5
    >Dig4=0
    >
    >How should I add the Decimal? (Please help me)
    >Or is it a setup problem of the MAX 7219? I don’t have a clue.
    >
    >
    >
    >
    >____________________________________________________________
    >Win a first-class trip to New Orleans and vacation Elvis Style!.
    >Enter NOW!
    >http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes/
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >




    _________________________________________________________________
    Send and receive Hotmail on your mobile device: http://mobile.msn.com
Sign In or Register to comment.