More outputs on a BS1 rev. D
akudaikon
Posts: 10
I've had a BS1 rev. D for a couple years now and could never figure out what do with it. Now I have an idea for a project over the summer, but I've run into an issue. I have a limited knowledge of electronics right now, so i'm trying to come up with ways from what I know to overcome it. The basic stamp only has 8 input/output pins, but I need to be able to independantly control 27 different LEDs while leaving 1 or 2 pins open for inputs. I was thinking of using a demultiplexer, but I cannot find any 1:32 demultiplexers to do this. Does anyone have any ideas or solutions to this problem? I'm sure there is a simple solution to this.
Thanks in advance for the help!
Thanks in advance for the help!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Edit: I guess Jon and I were typing at the same time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
Thanks again for the help!!
SYMBOL· SData·· = Pin0················· ' 74HC595 serial data· (14)
SYMBOL· Clock·· = 1···················· ' 74HC595 shift clock· (11)
SYMBOL· Latch·· = 2···················· ' 74HC595 output latch (12)
SYMBOL· temp··· = B0··················· ' work variable for LCD routines
SYMBOL· shift·· = B4··················· ' loop counter for SOut
SHIFT_OUT:·····
· FOR shift = 1 TO 8··················· ' shift 8 bits
··· SData = Bit7······················· ' MSB first
··· PULSOUT Clock, 1··················· ' clock the bit
··· temp = temp * 2···················· ' get next bit
· NEXT
· PULSOUT Latch, 1
· RETURN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Thanks a lot again for the help!
· target = rndValue // 26 + 5
The divisor for modulus is the max value minus the min value plus one (30 - 5 + 1 = 26).· The reason for this is that the modulus operator always returns a value between zero and the divisor-1, so in the code above the modulus portion would always return a value between 0 and 25.· Then we add the minimum value to bias the output to it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax