Shop OBEX P1 Docs P2 Docs Learn Events
led dot matrix display — Parallax Forums

led dot matrix display

PFloyd36069PFloyd36069 Posts: 135
edited 2010-02-27 21:31 in Propeller 1
hello,

i have a led dot matrix display similar to this one but not as fancy( http://www.avagotech.com/docs/AV02-0195EN), and i have got it working, and am able to type the numbers into the code( eg. three). i was wondering what i would need to do to be able to just send it a decimal from say another cog that is reading a sensor or something. ill post what i have so far·of the code....


Thanks,

Bryan

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2010-02-22 12:43
    Well, instead of using hardcoded digits (zero, one, ...) , you can use:
    value:= byte[noparse][[/noparse] @zero + (digit[noparse][[/noparse] 0 ]*5) ][noparse][[/noparse] i ] | byte[noparse][[/noparse] @zero + (digit[noparse][[/noparse] 1 ]*5) ][noparse][[/noparse] i ]<<7 | byte[noparse][[/noparse] @zero + (digit[noparse][[/noparse] 2 ]*5) ][noparse][[/noparse] i ]<<14 | byte[noparse][[/noparse] @zero + (digit[noparse][[/noparse] 2 ]*5) ][noparse][[/noparse] i ]<<21
    
    

    This way your code only has to change the values in the digit-array for displaying other numbers. You understand the change? @zero is the base address of your character-definitions. If you want to display a "0" you can start at address @zero + 0 * 5. If you want to display a "7" you'd start at address @zero + 7 * 5, because each character needs 5 bytes in your definition.

    But .. are you sure that you have to repeat the output loop when nothing has been changed?
  • PFloyd36069PFloyd36069 Posts: 135
    edited 2010-02-22 13:46
    Yeah that makes sense.· Im not sure though if it needs to repeat the output loop or not.·I cant really try it either because im at school right now.

    thanks,

    bryan
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-02-22 14:32
    I had a closer look into the datasheet and it looks like the controller has to send the data for each refresh cycel, so your loop is OK.
  • PFloyd36069PFloyd36069 Posts: 135
    edited 2010-02-23 02:07
    I·got it working·just·like i wanted it to·now. Thanks for the help
  • Mike HuseltonMike Huselton Posts: 746
    edited 2010-02-27 21:31
    Just came across this: www.edn.com/leds/article/ca6716496.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
Sign In or Register to comment.