99-0 countdown using seven segment display
ndupuy
Posts: 1
I have an assignment in which I have to make a seven segment display with two digits count down from 99 using subroutines.
This is the exact assignment:
Your assignment is to write a new program using subroutines to display numbers 0-9 on each digit of the 7-segment display. In total, you will need 21 subroutines: 0-9 for digit 1, 0-9 for digit 2, and a reset subroutine which turns off all segments. Once all the subroutines are created, you can easily count down from higher numbers. Create these subroutines and program the Boe-Bot to count down from 99 to 0.
I have made all of the subroutines, but do not know how to apply them to make a countdown. I am using bs2 and language 2.5.
I have attached what I have so far
Any help would be appreciated
This is the exact assignment:
Your assignment is to write a new program using subroutines to display numbers 0-9 on each digit of the 7-segment display. In total, you will need 21 subroutines: 0-9 for digit 1, 0-9 for digit 2, and a reset subroutine which turns off all segments. Once all the subroutines are created, you can easily count down from higher numbers. Create these subroutines and program the Boe-Bot to count down from 99 to 0.
I have made all of the subroutines, but do not know how to apply them to make a countdown. I am using bs2 and language 2.5.
I have attached what I have so far
Any help would be appreciated
Comments
I don't use the BS2 much myself but when I opened your program, I could see a list of demo programs in one of the left panes of the editor. The program "ON-GOSUB.BS2" caught my attention. After looking at the program, I'm pretty sure it supplies a pretty good example of what you want to do.
Here's another hint. I wrote some variables which I think would be helpful in your program.
I think you should remove all the "PAUSE" statements from the subroutines and just use one "PAUSE" in your main loop.
Hopefully the above will give enough to get you started looking in the right directions.