PDA

View Full Version : double digit counter



w. williams
02-18-2005, 05:53 AM
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.

KenM
02-19-2005, 09:32 AM
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. williams
02-19-2005, 09:43 AM
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 Schwartz
02-19-2005, 10:09 AM
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. williams
02-19-2005, 09:51 PM
ok thanks alot