Shop OBEX P1 Docs P2 Docs Learn Events
School Project BS2 — Parallax Forums

School Project BS2

GregNSCCGregNSCC Posts: 3
edited 2014-01-19 13:15 in BASIC Stamp
I am new to using the basic stamp 2 and am looking to write code so that it counts up from 0 to 3 each time (photo1 = 0) and then output to a 7 segment display using a ls7447 driver . Now on the debug screen I can see where the total for (score1) goes from 0 to 1 to 2 to 3 but the 7 segment only displays when it reaches a 3 and not when it is at 0, 1 or 2.

is there a better way to write this so that it will display the current total as it changes? If anyone has any input it would be greatly appreciate


solved thanks for the help

Comments

  • bsjohnbsjohn Posts: 19
    edited 2014-01-13 18:38
    Since this is a school project it wouldn't be right just to give you the answer but I'll give you a hint. Walk through with pseudo code what is happening in your FOR loop, refernce the Basic Stamp manual and you'll get to your answer.
    Good luck, John
  • ercoerco Posts: 20,257
    edited 2014-01-13 21:03
    Greg: Welcome to the forums. Per bsjohn, we want to help you figure this out, but not do it for you. I see two problems:

    1) You're incrementing variable score1 twice. The for/next loop, and your line "score1 = score1 + 1". Maybe not what you intended.
    2) Your 'next' command (if you keep it) ends your update loop. Shouldn't it come after your BCD output codes?
  • GregNSCCGregNSCC Posts: 3
    edited 2014-01-14 04:12
    ok, thanks for the help ill see what i can figure out today.
  • ercoerco Posts: 20,257
    edited 2014-01-15 17:01
    Greg: You marked "solved", that's great. How did you make out?
  • GregNSCCGregNSCC Posts: 3
    edited 2014-01-19 13:15
    good the issue was the next command it had to be moved to the bottom, thanks
Sign In or Register to comment.