is this possible? (input reading using i/o pin)
for my project i need to read the voltage from a circuit using the I/O pins.· Is this possible ?· from what i'm reading the RCTIME may be useful.. could someone explain this code for me ?· If the voltage reading wouldnt be accurate;· How can i get the i/o pin to get a high or low read from a device?
i'm very new. thanks
'
Post Edited (amotanis) : 11/14/2004 4:15:56 AM GMT
i'm very new. thanks
'
Post Edited (amotanis) : 11/14/2004 4:15:56 AM GMT
Comments
The RCTIME command measures the time it takes to charge and discharge a capacitor using a resistor and a capacitor circuit.· If you are trying to measure a voltage with an I/O pin, you'll first need to know the range of voltage that you working with.· The reason why, is due to·the fact that the BS2's I/O pins are TTL logic or 0 to 5 volts.· If you are using larger voltages you will need to use a voltage divider circuit in order to bring the voltages down to a TTL level.· The BS2 reads a high as 1.4v to 5v and a low as 0v to 1.4v.·
You can do a search on www.google.com for a voltage divider circuit.
Dave
Post Edited By Moderator (Aristides Alvarez) : 11/15/2004 1:11:05 AM GMT
If you can let us know more about the circuit and your objectives, we can probably refer you to a Stamps in Class text or article that will get you started.
Since this is new to you, consider reading and/or trying the experiments in the What's a Microcontroller text. That should get you up to speed pretty quickly. It's available for free download from www.parallax.com -> Downloads -> Stamps in Class Tutorials.
*if a solution comes to either of you let me know.
What's a Microcontroller Chapter 7, Activity 1 shows an example using a single photoresistor.· It's not difficult to expand that to an array of three.
Here also is a link to the QTI documentation:
http://www.parallax.com/detail.asp?product_id=28108