0

TCS34725 throws a random 44 in serial monitor
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

TCS34725 throws a random 44 in serial monitor

by Beatrice94 on Fri Sep 14, 2018 9:34 am

Hi everybody!

I am using TCS34725 from Adafruit to perform color measures and I noticed a very annoying thing: every time the sensor is initialized (tcs.begin(); or if tcs.begin is not called, at the first measurement), a number 44 pops up in my Arduino Serial monitor. After a bit of debugging and digging the library down, I found this

Code: Select all | TOGGLE FULL SIZE
boolean Adafruit_TCS34725::begin(void)
{
  Wire.begin();
 
  /* Make sure we're actually connected */
  uint8_t x = read8(TCS34725_ID);
  Serial.println(x, HEX);
  if (x != 0x44)
  {
    return false;
  }
  _tcs34725Initialised = true;

  /* Set default integration time and gain */
  setIntegrationTime(_tcs34725IntegrationTime);
  setGain(_tcs34725Gain);

  /* Note: by default, the device is in power down mode on bootup */
  enable();

  return true;
}

in the .cpp file of the Adafruit library. Now, I want my results on the serial monitor to be nice as I have to pass them to Processing to be saved on a file, so I'm really really tempted to comment that Serial.println() out so that it doesn't happen again. Can anyone tell me if there is a reason to print out that value other than debugging? Since my system is working aside from that 44, is everything going to blow up if i // the Serial.print?

Thanks

Beatrice94
 
Posts: 16
Joined: Wed Jun 06, 2018 7:00 am

Re: TCS34725 throws a random 44 in serial monitor

by adafruit_support_bill on Fri Sep 14, 2018 9:56 am

It is just printing the device identification number - verifying that it is indeed a TCS34725. You can safely comment out the Serial.println(x, HEX);.

adafruit_support_bill
 
Posts: 69235
Joined: Sat Feb 07, 2009 10:11 am

Re: TCS34725 throws a random 44 in serial monitor

by Beatrice94 on Fri Sep 14, 2018 10:28 am

Yay! Works smoothly now, thanks!

Beatrice94
 
Posts: 16
Joined: Wed Jun 06, 2018 7:00 am

Please be positive and constructive with your questions and comments.