Log in

View Full Version : Magnetic Sensor


akavoor13
16-02-2014, 22:26
We are trying to use a magnetic reed sensor with our pneumatic system. I know the sensor gets connected to digital I/O. In Java, once I define a variable of type "DigitalInput," what do I do with it? i.e., how do I use the information I get from the digital I/O? Many thanks!

cgmv123
16-02-2014, 22:30
We are trying to use a magnetic reed sensor with our pneumatic system. I know the sensor gets connected to digital I/O. In Java, once I define a variable of type "DigitalInput," what do I do with it? i.e., how do I use the information I get from the digital I/O? Many thanks!

DigitalInput.get(); returns a boolean corresponding to the input.

Team3266Spencer
16-02-2014, 22:38
http://robotics.francisparker.org/javadoc/edu/wpi/first/wpilibj/DigitalInput.html