Shop OBEX P1 Docs P2 Docs Learn Events
6 x16 segment l.e.d — Parallax Forums

6 x16 segment l.e.d

wb7076wb7076 Posts: 29
edited 2010-01-29 06:08 in Propeller 1
Okay i have figured out how to display what i type in the program by replacing the text in the "". i need help!
iam trying to figure out.. if i have a var holding a number, how can i display it insted of typing in the " " spot. iam trying to make a count down timer
using the 16 segment l.e.d's

here's my code Iam using the 16 segment obj , and the string obj also
can any one help me with this issue

Comments

  • VIRANDVIRAND Posts: 656
    edited 2010-01-26 04:53
    Where I live we aren't allowed to make that because we are surrounded by idiots who think its a bomb.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    VIRAND, If you spent as much time SPINNING as you do Trolling the Forums,
    you'd have tons of awesome code to post!
    (Note to self)
  • BradCBradC Posts: 2,601
    edited 2010-01-26 09:49
    What you probably want is to replace that string with a call to num.decd. Have a look at the simple numbers object. In there you will certainly find a method that allows you to convert an integer into a string of your liking.

    Next time, if you could use the File -> "Create Propeller Archive" option and upload the zip file, it would be a lot easier to figure out what is going on. I don't know what "WB Strings" is / does.

    Having said that, nice screen shot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • wb7076wb7076 Posts: 29
    edited 2010-01-26 17:22
    Brad iam a new 22 days in. i have to self teach myself every thing about the prop chip and writing code. learning the languge is like being lost in a car, you know how to drive you, just dont know where your at.

    Thanks for the help, got any tips where i could learn more techniques about writing code?

    7 desktops
    1600 x 1200 - 607K
  • AJMAJM Posts: 171
    edited 2010-01-26 17:38
    Nice setup

    Take a look at the propeller downloads page: Link

    Have a glance through the PE Lab book. It has many examples and is very straightforward
  • wb7076wb7076 Posts: 29
    edited 2010-01-26 17:51
    and i used the 16 segment object, and the strings object. i found in the object exchange

    i just renamed them WB strings

    i dont know what it does. there is no write up on it. if it was explained like some of the examples ...boy the kid could be a rockit scientist

    look a new book is out! going to get it. hope its well explained

    here's the code.
  • wb7076wb7076 Posts: 29
    edited 2010-01-26 21:44
    what is a call to num.decd. ?

    and any examples with a write up, using simple numbers object?
  • BradCBradC Posts: 2,601
    edited 2010-01-29 06:08
    Add the simple numbers to your program :

    OBJ
      led : "WB SixteenSegment"
      s   : "WB Strings"
      num : "Simple_Numbers"
    
    



    Then change the send() line in your time routine to look like this :
      Send(num.decf(time,numchars))
    
    


    Where time = 123 you get the following :

    time is the value you want to print to the display, numchars comes from your constant block and tells the decf routine to space the number out to 6 characters
    " 123"

    If you wanted it padded by 0's instead, you would use decx(time,numchars).
    "000123"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
Sign In or Register to comment.