Triggering input pin with an output pin on the same BS2?
Blake
Posts: 74
A simple technical question:
Can I use one pin (pin0) set to high output to trigger another pin (pin1) set to input on the same stamp? I would like to attach wires to the input and output pins spaced apart so that when they came into contact with a strip of metal they would act as a switch for the stamp. Would I need some resistors in this scenario?
Thanks,
Blake
Can I use one pin (pin0) set to high output to trigger another pin (pin1) set to input on the same stamp? I would like to attach wires to the input and output pins spaced apart so that when they came into contact with a strip of metal they would act as a switch for the stamp. Would I need some resistors in this scenario?
Thanks,
Blake
Comments
Lots of educational info out there on ther Stamp. You should read the What's a Microcontroller book on basic switch inputs. Great place to start, and author Andy Lindsay explains it all very well. Good luck.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
If you want a switch type of circuit, you must use a switch type device. The device can be an actual switch, or a relay, magnetic contacts, a micro-switch, or anything else that acts like a switch.
The Stamp can only provide a + or - 5 VDC from its pin ports, period.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON
I hope I'm not reading your posts wrong guys,
Thanks,
Blake
Second answer -- the problem is, when the input pin is "floating", in effect it has "no definite state". So you'll need a 10 Kohm 'pull-down' resistor on that pin (other side of resistor to Vss), to give that pin a default "low" state. Result -- when the switch is open, the input reads the 'low'. When the switch is closed, the state of the output pin is read.
But it's easier to connect the 'far' end of the switch to +5, without using another I/O pin. Since you need the 10K pull-down in any case.
Oh, another name for a "floating input" pin is "antenna". Without any termination, it usually picks up 60 Hz RF noise which LOOKS like a noisy signal.