View unanswered posts | View active topics It is currently Wed Dec 11, 2019 8:24 pm






Reply to topic  [ 3 posts ] 
Set EV3 color sensor in green mode 
Author Message
Rookie

Joined: Thu Apr 02, 2015 6:16 pm
Posts: 12
Post Set EV3 color sensor in green mode
I must turn it green in the middle of the program. I have already tried the SensorType and SetSensorMode commands but i could not find a green mode. Anyone knows how to do this?


Fri May 01, 2015 2:41 pm
Profile
Rookie

Joined: Thu Apr 02, 2015 6:16 pm
Posts: 12
Post Re: Set EV3 color sensor in green mode
This topic only shows how to do it in the Nxt, and i am using Ev3. It is not the same command


Sun May 03, 2015 8:16 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Set EV3 color sensor in green mode
If you are looking to use it as a "lamp", you can't. It's not a supported feature for that sensor. If you're simply looking to get the amount of reflected green light, use this code:
Code:
#pragma config(Sensor, S1,     COLOUR,         sensorEV3_Color, modeEV3Color_Color)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
  long dummy, green;
  while (true)
  {
    getColorRGB(COLOUR, dummy, green, dummy);
    displayTextLine(3, "G: %d", green);
    sleep(50);
  }
}

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Mon May 04, 2015 12:03 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.