Shop OBEX P1 Docs P2 Docs Learn Events
Multiple switches and lights — Parallax Forums

Multiple switches and lights

cefncefn Posts: 2
edited 2006-01-09 04:55 in BASIC Stamp
If I want to handle multiple buttons, and use button pushes from these multiple buttons to control multiple lights ( > 100 of both)

How would I go about doing this with a Stamp or other microprocessor?

I'm comfortable with the Stamp programming concepts, but presumably need some kind of co-processor to handle so many connections.

Also perhaps interrupt capabilities are required to allow 100 switches to be monitored simultaneously. I don't know if this is supported on any Stamp platform.

If anyone has a pointer to an existing project, or can suggest the hardware i need to consider, this would be very helpful.

Comments

  • Lee HarkerLee Harker Posts: 104
    edited 2006-01-09 00:13
    There are a couple of practical ways you can do this. One method would be to daisy chain shift registers for your input switches so that you could read the values at 100 different inputs. Likewise use shift registers to drive your LEDs. The Parallax documentation shows examples of this. Another way to read many switches is by placing them in a matrix of 10 rows by 10 columns and scan them as you would any smaller keypad. Once again you would want to use shift registers to reduce the Stamp pin count necessary. You could also drive the LEDs in a matrix fashion.
    One thing to keep in mind is that when you read switches or drive LEDs in a matrix configuration, only one switch can be read and only one LED can be lit at a time. There is also the issue of speed. It takes a finite perriod of time to read a matrix of keys. If the timing wasn't too critical it should be doable.
  • Clock LoopClock Loop Posts: 2,069
    edited 2006-01-09 04:55
    I did a similar project with many switches and leds. The best way IS with shiftregisters.

    Use 74HC595's to light up your LEDS.....

    And use 74hc597's (or74HC165's) to read the switch states.
Sign In or Register to comment.