Sensor Help needed (I'm a noob)

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

Moderators: roger, gloomyandy, skoehler

New User
Posts: 1
Joined: Sun Nov 08, 2015 3:14 am

Sensor Help needed (I'm a noob)

Postby LucasIgnacioR » Sun Nov 08, 2015 3:48 am

Hello everybody, I've just registered because I'm interested in creating a project that requires a more sophisticated programming language than the basic Mindstorms programming environment.

However, I'm not terribly familiar with Java (or other programming languages, for that matter) and so far I've only made the motors work in the most basic of ways.
I'm using a ton of reference material to understand Java, so I don't think that'll be a problem. However, I'm having a lot of trouble finding references to understand how Lejos can use the input of sensors.

So, I'm asking the people in this forum some things, starting with the sensor thing

How do I set the sensor in a program? In other words, how do I tell the project I'm currently writing "Hey, I need to read values coming from the Color Sensor, using reflected light mode, from port 2." (for example).

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

Re: Sensor Help needed (I'm a noob)

Postby gloomyandy » Sun Nov 08, 2015 11:18 am

I've moved your question to a more relevant part of the forum. So what have you looked at so far. Have you read the leJOS Wiki pages:
In particular look at the section on the sensor framework
Have you look at the class reference documentation for the EV3 color sensor: ... ensor.html
The sensor mode you are interested in is red mode which will allow the framework to access the reflected light from the red LED.
Have you read the many articles in the leJOS new blog:
In particular take a look at the ones concerning the sensor framework: ... framework/
The first example program in the following article shows you have to open read and display samples from sensors: ... o-samples/
Finally have you looked at the various sample programs that came with your leJOS install? This one shows how to use the sample filters, but you can ignore that part and just look to see how to use the red mode for the colour sensor: ... o-samples/

None of the above will do exactly what you want, but spend a bit of time reading the examples and the background and you should be able to work it out....
leJOS news

Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 1 guest