Programming 1 digit 7 segment display help.
So i'm writing a program with the basic stamp 2 that gets a number from a remote, then plays the morse code for that number while displaying the number on a 7 segment display. right now the program has about 150 lines that are telling the stamp how to display the numbers using the HIGH and LOW commands. is there any way i can shorten it. here is the part of the program. tr, br, tl, bl, top, bot, mid stand for what part of the display it's controlling. Help.
one:
GOSUB clear
HIGH tr
HIGH br
RETURN
two:
GOSUB clear
HIGH top
HIGH tr
HIGH mid
HIGH bl
HIGH bot
RETURN
three:
GOSUB clear
HIGH top
HIGH tr
HIGH br
HIGH mid
HIGH bot
RETURN
ect......
clear:
LOW top
LOW mid
LOW bot
LOW br
LOW bl
LOW tr
LOW tl
one:
GOSUB clear
HIGH tr
HIGH br
RETURN
two:
GOSUB clear
HIGH top
HIGH tr
HIGH mid
HIGH bl
HIGH bot
RETURN
three:
GOSUB clear
HIGH top
HIGH tr
HIGH br
HIGH mid
HIGH bot
RETURN
ect......
clear:
LOW top
LOW mid
LOW bot
LOW br
LOW bl
LOW tr
LOW tl
Comments