HELP plz Basic stamp seven segment display question: Student
jeffpops
Posts: 12
Writing a program to run 3 seven segment displays to count from 0-999 in 10 seconds! My wiring is gotta br right bc i checked it/built it several times. Pic below:
My code i have wrote may be the problem. Pic below..
Can someone please help me see what im doing wrong or ill get no sleep tonight.. ha thanks
Code i wrote:
' {$STAMP BS2}
' {$PBASIC 2.5}
DIRS=%111111111111
hundredscounter VAR Byte
tenscounter VAR Byte
counter VAR Byte
OUTC=%0000
FOR hundredscounter= 1 TO 9
OUTB=%0000
FOR tenscounter = 1 TO 9
OUTA=%0000
FOR counter = 1 TO 9
OUTA=OUTA+1
PAUSE 10
NEXT
OUTB=OUTB+1
PAUSE 10
NEXT
OUTC=OUTC+1
PAUSE 10
NEXT
END
My code i have wrote may be the problem. Pic below..
Can someone please help me see what im doing wrong or ill get no sleep tonight.. ha thanks
Code i wrote:
' {$STAMP BS2}
' {$PBASIC 2.5}
DIRS=%111111111111
hundredscounter VAR Byte
tenscounter VAR Byte
counter VAR Byte
OUTC=%0000
FOR hundredscounter= 1 TO 9
OUTB=%0000
FOR tenscounter = 1 TO 9
OUTA=%0000
FOR counter = 1 TO 9
OUTA=OUTA+1
PAUSE 10
NEXT
OUTB=OUTB+1
PAUSE 10
NEXT
OUTC=OUTC+1
PAUSE 10
NEXT
END
Comments
You may need to adjust the "PAUSE 10" delays. The Basic statements themselves take a little time to execute and that will cause the whole thing to take longer than the 10 seconds you want.
Tried to single out this command to my display and its still not working right!
' {$STAMP BS2}
' {$PBASIC 2.5}
DIRS=%111111111111
OUTA=%0000
FOR counter = 1 TO 9
OUTA=OUTA+1
PAUSE 10
NEXT
END
If the segments are not lighting up correctly, then you must have some sort of wiring error around the 7447s. Check your wiring carefully. Draw a schematic from the actual wiring (not what you think it should be), scan it in, and post it here as an attachment. The photo doesn't show the wiring well enough.
' {$STAMP BS2}
' {$PBASIC 2.5}
DIRS=%11111111
counter VAR Byte
OUTA=%00000000
FOR counter = 1 TO 9
OUTA=OUTA+1
PAUSE 3000
NEXT
END
In situations like this one, I always painstakingly go and compare the datasheet diagram with a hand drawn schematic made from the actual wiring. Sometimes it helps to have someone else do the comparison since we "know" what the wiring is supposed to be. One of the signs of a really good programmer is the ability to look at a piece of code that you've written and really look at it as if someone else had written it. Same thing is true for hardware.