How to print lightvalues

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

Moderators: roger, gloomyandy, skoehler

poulabildgaard
New User
Posts: 15
Joined: Thu Jun 15, 2017 1:52 pm

How to print lightvalues

Postby poulabildgaard » Thu Jun 15, 2017 1:58 pm

Hi. I am new to EV3 and have lots to learn, so please be patient :)
In NXT i could simplly write: System.out.println(LightSensor.getLightValue()) and it worked perfectly. But using EV3 I simply don't understand it. How do I list the values collected by the LightSensor (or actually the ColorSensor)? I'm sure it perfectly simple, but thanks fo rany help. I would appreciate a full code if possible.

Thanks
Poul

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

Re: How to print lightvalues

Postby gloomyandy » Thu Jun 15, 2017 2:07 pm

Hi,
the following explains how the sensor framework works...
https://sourceforge.net/p/lejos/wiki/Se ... Framework/
The EV3 doc gives details of the modes supported by the various sensors...
http://www.lejos.org/ev3/docs/lejos/har ... ensor.html

Once you have obtained the readings using the fetch sample call, you simply display them using standard Java I/O
leJOS news https://lejosnews.wordpress.com/


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 1 guest