Thread
:
A relatively dumb question...
View Single Post
#
3
15-01-2015, 21:26
TFleig78
Registered User
AKA: Tyler
FRC #0078 (Air Strike)
Team Role: Programmer
Join Date: Jan 2013
Rookie Year: 2012
Location: Rhode Island
Posts: 58
Re: A relatively dumb question...
Use:
Code:
AnalogInput ultraSonic = new AnalogInput(0);
Then to get a reading:
Code:
ultrasonic.getVoltage();
Then you need to scale the voltage (0-5) to a distance, using a constant which should be in the documentation for the ultrasonic sensor.
TFleig78
View Public Profile
Find all posts by TFleig78
Find CD-Media Photos by TFleig78
Find CD-Media Papers by TFleig78