Some questions I wished I thought of BEFORE I saughtered my circuts.
Armored Cars
Posts: 172
I wanted to make sure before I fired it up that the pins are negeitive, and I thought that the white wire from an RC servo could·be connected directly to·a pin on the·BS2, but·I run mine on 6v (recomended), which if I am correct will damage the stamp.· Ethier I am incorrect, yall run less than 6v, or I need a resistor or voltage reg between the servo or the stamp.
Comments
Connections:
-- White: To control pin on BASIC Stamp
-- Red: To positive side of supply (5 to 6 volts)
-- Black: Common ground (must be connect to supply ground and BASIC Stamp ground)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
I didn't think there were any negative voltages with the BS2 -- ok, *maybe* the RS-232 input signal from the PC goes negative during signaling. What 'negative' are you talking about?
And you don't really 'put power to a pin to define it as an input', there is a PBasic keyword ("INPUT MyPin") which defines the pin as an input. If you are reading a voltage off of a switch, you should read the BS2 manual for 'Button' -- this shows the schematic of how to wire the switch and resistor, and the BS2 pin.
I cant really complain because at·someone is·trying to help...
I have a pin.· There is a pushbutton connected to the pin.· I want the BS2 to read when the pushbutton is depressed, the program is already written.· Lets say I have a 5v battery.· Do I attatch the side with the +·written on it or the side with the - written on it?
All I want·to know is which way·must current flow through the pins of the BS2.
Connect the Stamp pin to the ground (VSS or minus on the battery) through a 1K Ohm or so resistor.· This will keep the pin pulled low and prevent it from "floating" and giving you a false positive.· To the same pin, connect a pushbutton to the positive (VDD) rail.· When you push the button, you will pull the pin positive, and detect the button press.· Good luck and happy stamping.
peter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Peter C. Charles
Director, Research and Technology
CyberBiota, Incorporated
Peter.charles@cyberbiota.com
http://www.cyberbiota.com
Basically, the switch is in series with a 10K ohm resistor across +5 to GND. +5 volts wired to Switch +, Switch - (bottom) wired to Resistor +, Resistor - wired to GND. Switch(bottom) then wired to the BS2 pin.
When you close the switch, you conduct current through the resistor, and the bottom of the switch is at 5 volts. When you open the switch, no current flows, and the bottom of the switch is at 0 volts. If you then attach the BS2 pin to the bottom of the switch, the BS2 can read the value at the bottom of the switch.
The BS2 'input's are very high-impedance (high-resistance) sensors. They don't take readings by conducting a lot of current into the BS2 -- they take readings by sensing what the voltage is on the pin. It sounds like you think you should wire the switch directly to the BS2, so when the switch is open no current flows, and the BS2 senses this -- this is *not* how the BS2 works.