TCS34725 throws a random 44 in serial monitor

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Beatrice94
 
Posts: 18
Joined: Wed Jun 06, 2018 7:00 am

TCS34725 throws a random 44 in serial monitor

Post by Beatrice94 »

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

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

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: TCS34725 throws a random 44 in serial monitor

Post by adafruit_support_bill »

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);.

User avatar
Beatrice94
 
Posts: 18
Joined: Wed Jun 06, 2018 7:00 am

Re: TCS34725 throws a random 44 in serial monitor

Post by Beatrice94 »

Yay! Works smoothly now, thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”