distance unit

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

New User
Posts: 23
Joined: Thu Apr 06, 2017 2:43 am

distance unit

Postby moo » Wed Apr 26, 2017 2:39 am

What are units for measuring distance for IR and Ultrasonic sensors?

EV3UltrasonicSensor ul = new EV3UltrasonicSensor(SensorPort.S2);
RangeFinderAdapter sonar = new RangeFinderAdapter(ul.getDistanceMode());

EV3IRSensor ir = new EV3IRSensor(SensorPort.S4);
RangeFinderAdapter sonar = new RangeFinderAdapter(ir.getDistanceMode());

User avatar
leJOS Team Member
Posts: 5869
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: distance unit

Postby gloomyandy » Wed Apr 26, 2017 7:07 am

In general leJOS uses SI units for sensor values. The documentation provides the details:
http://www.lejos.org/ev3/docs/lejos/har ... ensor.html

http://www.lejos.org/ev3/docs/lejos/har ... ensor.html

The IR sensor does not provide a linear return for the distance to an object, the value can also vary depending upon the surface of the object, so we do not attempt to define a unit. We simply return the value that the sensor provides. Generally smaller values mean that the object is closer.

Why not simply try these things, a few quick tests will soon give you a feel for how the sensor works, how wide the detection area is and much more.
leJOS news https://lejosnews.wordpress.com/

Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 3 guests