Reading analog sensor
martin8675309
Posts: 1
I was looking for some code examples of how I can take a R146-GP2D120 sensor http://www.acroname.com/robotics/parts/R146-GP2D120.html that has a range of 1.6" - 12" to only see anything within a 4 inch range. I want to wave a hand in front of a lamp twice to turn it on but I don't understand how you would code this for the BS2 to go high when it sees a certain voltage when a hand is within 4 inches of the sensor. I am just learning so if you could really explain it that would be most helpful.
Thanks
Thanks
Comments
http://www.parallax.com/Store/Components/AllIntegratedCircuits/tabid/154/CategoryID/31/List/0/SortField/0/Level/a/ProductID/575/Default.aspx
If the voltage is greater than 1.25 volts then you hand is within 4 inches.
John Abshier