Two inputs on one switch

wim

Member
may I connect to picaxe chips to one switch ? I use a 08m2 protoboard and a 20m2 protoboard and need to read the switch on both boards.
is this okay?
 

Attachments

westaust55

Moderator
Yes that can be done with one switch wired to a input on two different PICAXE chips.

Suggest that you add say a 220/330 ohm resistor in line to both PICAXE input as protection in case they are accidentally programmed as outputs with switch closed to +5V or one high and one low.

If the pull-down on 20M2 is not part of a proto board as standard, a single 10k pull-down would suffice.
 

hippy

Technical Support
Staff member
This is how I would wire things. The 1K can be made lower as westaust55 suggests ...

Code:
 .-_-.
-|   |-   __              /
-|   |---|__|---.----.---o o-- +V
-|   |-   1K    |    |
 `---'          |   .|.
 .-_-.          |   | | 10K
-|   |-   __    |   |_|
-|   |---|__|---'    |
-|   |-   1K        _|_ 0V
 `---'
 

Reloadron

Senior Member
As drawn will there be a potential problem with switch bounce or is that taken care of in the code? Just curiosity on my part.

Thanks
Ron
 

fernando_g

Senior Member
Of course, I've to add -because it is not implicitly shown in the schematic- that both Picaxes have to share both the same Vdd and ground.
 
Top