voltage values
nico
Posts: 28
hi,
from the below code, it is said that if i supply a 5v to pin 0, the value y will be 1. if it is a 0v·y will be a 0. However, what if I have a 2v?
Will y be 0 ? What is the range of the volts to make the value y to be 0?
from the below code, it is said that if i supply a 5v to pin 0, the value y will be 1. if it is a 0v·y will be a 0. However, what if I have a 2v?
Will y be 0 ? What is the range of the volts to make the value y to be 0?
x pin 0 y var word IF x = 1 THEN y = 1 ELSE y = 0 ENDIF
Comments
With classic TTL circuitry (like a 74LS04 inverter chip), 0 to 1.4 volts would be a 'hard' zero, while 2.4 to 5 volts would be a 'hard' one, and anything in the middle is "don't go there", like dividing by zero the result is "undefined".
The BS2 is CMOS based, but I think above 2.4 it's guaranteed to see a 'one'.
You may want to use a pull-down or a pull up resistor to force your levels to be what you want them to be, there's some info in the What's a Microcontroller book online that shows this.
·http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Wamv2_2.pdf
Then, put a 10K resistor from one (the receiving one) Stamp pin to ground to "pull-down" the signal when the sending Stamp is trying to hold the line at 0 volts.
Don't forget that the 0 volts of both Stamps have to be tied together.
········································· 220
Stamp1 pin
/\/\/\/\
Stamp2 pin
···················································································· |
····················································································· \
····················································································· / 10K
····················································································· \
····················································································· /
···················································································· |
··
0 volts
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
Post Edited (stamptrol) : 1/28/2010 5:46:23 PM GMT
By doing that won't the current will always flows to the ground. so no matter what happen stamp2 pin will be reading a 0v ? This is because my stamp1 is to send values either a 1 or a 0 (a 5v or 0v) to my stamp2 to read. But by doing this, won't it means i will be getting my the stamp2 to read a 0 all along ?
When Stamp1 pin is low, the 10K helps "pulldown" Stamp2 pin so it is seen as a 0.
It'll take 5 minutes to try!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·