View Single Post
  #3   Spotlight this post!  
Unread 15-01-2015, 21:26
TFleig78's Avatar
TFleig78 TFleig78 is offline
Registered User
AKA: Tyler
FRC #0078 (Air Strike)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rhode Island
Posts: 58
TFleig78 will become famous soon enoughTFleig78 will become famous soon enough
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.
Reply With Quote