bug with RGB (v3.51)
Page 1 of 1

Author:  flymic88 [ Wed Oct 31, 2012 8:31 am ]
Post subject:  bug with RGB (v3.51)

I updated my robotC (3.04 to 3.51) but my RGB sensor bug.

#pragma config(Sensor, S3,     RGB,            sensorCOLORFULL)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
   int val, raw, R, G, B;
  short ColorTab[3]={0,0,0};

while (true)
      val = SensorValue (RGB);
      raw = SensorRaw (RGB);
      nxtDisplayCenteredTextLine (1, "%d : %d", val, raw);

      getColorSensorData(RGB, colorRaw, &ColorTab );   //fonction qui permet de stocker dans un tableau ColorTab les valeurs bruts du capteur RGB
     R = ColorTab[0];   //affecte dans R,G,B les differantes valeurs mesurees
     G = ColorTab[1];
     B = ColorTab[2];
     nxtDisplayCenteredTextLine (3, "%d / %d / %d", R, G, B);


This code returns good values in R, G and B with RobotC 3.04, but in 3.51, sensorRaw and getColorSensorData return juste "0" :-(
Or it is possible to use the color sensor v2 by HiTechnic with RobotC 3.04?!
please help me quickly :bow:

Author:  swe_mckvack [ Mon Jan 07, 2013 6:20 pm ]
Post subject:  Re: bug with RGB (v3.51)

I just spent 3 hours debugging my code before i found this bug report.
Tried running the example ColorSensor.c (LEGO Color Sensor) and that doesn't work either.

Author:  mightor [ Tue Jan 08, 2013 3:10 am ]
Post subject:  Re: bug with RGB (v3.51)

The LEGO Colour Sensor and the HiTechnic Colour Sensor are two completely different sensors. For the HT one, you need to use sensorI2CHiTechnicColor and not sensorCOLORFULL, which is for the LEGO sensor.

= Xander

Author:  swe_mckvack [ Tue Jan 08, 2013 5:08 am ]
Post subject:  Re: bug with RGB (v3.51)

I can speak for flymic88 but I use the LEGO Color Sensor.

Author:  swe_mckvack [ Tue Jan 08, 2013 5:18 am ]
Post subject:  Re: bug with RGB (v3.51)

For a longer explanation:
When running the example code the main screen that shows AtoD, Raw and Value does not work. If I change mode to e.g. RED (pushing left/right button) than all the values are displayed in realtime and with correct values.
So the problem seen to be when the sensor is in RGB mode

Author:  flymic88 [ Fri Jan 25, 2013 6:09 am ]
Post subject:  Re: bug with RGB (v3.51)

Well my competition passed, I was able to put on 2 sensors with the version 3.08 of robotC with good driver.
I understood why this bug, but I have pus to make without.
Thank you all the same

Author:  tfriez [ Wed Jan 30, 2013 10:16 am ]
Post subject:  Re: bug with RGB (v3.51)

This issue is related to the addition of pointers/recursion to the firmware. Looks like every build from 3.50 moving forward has had this issue, but you're the first one to report it.

We're working on a fix at the moment in firmware and will have a new BETA release soon that will have the fix. I'll send you an e-mail or a PM when this occurs.


Author:  swe_mckvack [ Sat Apr 27, 2013 7:29 am ]
Post subject:  Re: bug with RGB (v3.51)

Is this fixed in the new release?

Author:  mightor [ Sat Apr 27, 2013 7:56 am ]
Post subject:  Re: bug with RGB (v3.51)

Yes, the colour sensor works very well in 3.60.

= Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group