Shop OBEX P1 Docs P2 Docs Learn Events
double digit counter — Parallax Forums

double digit counter

w. williamsw. williams Posts: 9
edited 2005-02-19 14:51 in BASIC Stamp
does anyone know the code for·a double digit counter.· the website only offers the code for a single digit counter. thanks for the help.

Comments

  • KenMKenM Posts: 657
    edited 2005-02-19 02:32
    What websight are you referring to?

    Also, can you be more specific about a two digit counter?

    Exactly what are you trying to do?
  • w. williamsw. williams Posts: 9
    edited 2005-02-19 02:43
    oh sorry bout that. i was referring to the parallax website, where in the experiment section for the BS2 stamp they only have the code for a single digit counter. I'm working on a scoreboard project and i needed the code for a double digit counter that is controlled by a switch to keep score.
  • Robert SchwartzRobert Schwartz Posts: 141
    edited 2005-02-19 03:09
    It would just be the same code as a single digit counter, but you would increment the second digit (10s place) after the first digit equals 9. For example when you increment the score you would need to add:

    if OnesPlace = 9 then addTen

    addTen:
    OnesPlace = 0
    TensPlace = tensPlace + 1
  • w. williamsw. williams Posts: 9
    edited 2005-02-19 14:51
    ok thanks alot
Sign In or Register to comment.