• Post Reply Bookmark Topic Watch Topic
  • New Topic

four digit counter up/down on button click

 
Jaggu Yadu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All

The figure shows a counter, which can be operated using a button called up/down button.Can anybody help me to find a logic to do this.It should incremnt the value from 1 to 9 then 10 sould be writen as 1 and 0 on defferent fields.

|--------|-------|-------|-------|
| | | | | | 0 | 0 | 0 | 0 |
| | | | |
| | | | |
|--------------------------------|

|-------|
|UP/DOWN|
| |
|-------|

Please help me....
Tanks in advance..

Jaggu
 
Karen Nelson
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are lots of ways to do this, so you should at least try some pseudocode first and send us that. You might want to think about making an array of 4 integers, and when you are incrementing the counter, testing whether the last counter position = 9. If so, what do you need to do...?

-Karen.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!