Shop OBEX P1 Docs P2 Docs Learn Events
tell me what I am doing wrong. — Parallax Forums

tell me what I am doing wrong.

TCTC Posts: 1,019
edited 2008-08-20 23:04 in BASIC Stamp
I am using a MAX7219. I am trying to place a·decimal point with digit number 2. But instead, the display drops brightness, and locks digit 2. What am I missing.
sensor    CON 0
DATA_n    CON 1
CLK       CON 2
Load      CON 3
decode    CON 9
brite     CON 10
scan      CON 11
switch    CON 12
test      CON 15
max_dat   VAR Word
index     VAR Nib
temp      VAR Nib
nonZ      VAR Bit
dispVal   VAR Word
odd       VAR index.BIT0
DP        VAR index.BIT3
 
OUTS = 0
DIRS = $000E
 
  FOR index = 0 TO 7
  LOOKUP index,[noparse][[/noparse]scan,2,brite,15,decode,$7,switch,1],max_dat
  SHIFTOUT DATA_n,CLK,MSBFIRST,[noparse][[/noparse]max_dat]
  IF odd = 0 THEN noLoad
  PULSOUT Load,1

NoLoad:
  NEXT
 
Loop:
  GOSUB MaxDisplay
  COUNT sensor,2930,dispVal
  GOTO LOOP
 
MaxDisplay:
  nonZ = 0
  FOR index = 3 TO 1
  GOSUB ADD_DP
  SHIFTOUT DATA_n,CLK,MSBFIRST,[noparse][[/noparse]index]
  temp = dispVal DIG (index-1)
  IF temp = 0 THEN skip1
  nonZ = 1

skip1:
  IF nonZ = 1 OR temp <> 0 OR index <= 2 THEN skip2
  temp = 15

skip2:
  SHIFTOUT DATA_n,CLK,MSBFIRST,[noparse][[/noparse]temp]
  PULSOUT Load,5
  NEXT
  RETURN

ADD_DP:
  IF index = 2 THEN ADD_DP1
  RETURN

ADD_DP1:
  DP = 1
  RETURN

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
We all make mistakes when we are young………That’s why paste is edible!

Comments

  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-08-18 11:28
    TC

    Please give a link to the dislplay that you are using

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • TCTC Posts: 1,019
    edited 2008-08-18 20:15
    Thanks PJ for posting the link before I could. also, here is the appkit that I copied from.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    We all make mistakes when we are young………That’s why paste is edible!
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-08-19 13:09
    TC

    What LED Display are you using can post a link to it

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • TCTC Posts: 1,019
    edited 2008-08-19 13:47
    sam_sam_sam said...

    TC

    What LED Display are you using can post a link to it

    It is a three digit 7-segment display drivin by a MAX7219, PJ already posted the link for the MAX7219. It is just a LED controler/driver.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    We all make mistakes when we are young………That’s why paste is edible!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-08-20 23:04
    TC,

    The code for the Binary / Digital Clock uses the decimal points for the colons in the display. You should be able to see how I turn them on/off by simply setting a bit in the data sent out to the MAX7219. I hope this helps. Take care.

    http://forums.parallax.com/showthread.php?p=552892

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.