Selection of Data String

Hi, I am working with a sensor that gives out a series of three strings data that I want to visualize in the serial monitor. The problem I have is that as first printout at the SM the system returns a number (44 actually) that has nothing to do with the sensor readouts but is messes up the serial communication with another app I am writing in Python. How can I prevent that number 44 for being returned/printed. Thanks, Alejandro.

Are you allowed to tell us which sensor and give us a link to a datasheet?

Can you post your Arduino code? (Also an example of EXACTLY what the sensor sends would be useful to test with.)

void loop() {
  byte ReadByte;
  if(Serial1.available()) {
    ReadByte = Serial1.read();
    if(ReadByte != 44) Serial.print(ReadByte);
  }
}

the sensor is the TCS34725 from adafruit. This is a color sensor that gives an output from its red, green and blue channels. The int 44 is interpreted as the first int, put as an output for the red channel (String[0]) and so the program stalls. This is the Arduino code:

#include <Wire.h>
#include "Adafruit_TCS34725.h"
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_101MS, TCS34725_GAIN_4X);
const int activationPin=13;
const int sensorLEDpin= 3;
const int lightpin=11;

void setup(void) {
pinMode(activationPin, OUTPUT);
pinMode(sensorLEDpin, OUTPUT);
pinMode(lightpin, OUTPUT);
Serial.begin(9600);

void loop(void)
{
digitalWrite(activationPin, HIGH);
analogWrite(sensorLEDpin, 1);
analogWrite(lightpin, 15);
uint16_t r, g, b, c, colorTemp, lux;
tcs.getRawData(&r, &g, &b, &c);
Serial.print(r,DEC); Serial.print(","); Serial.print(g,DEC); Serial.print(","); Serial.print(b,DEC);
}

What happens if (for test purposes) you put delay(200); immediately after the Serial.print line

Most people here prefer to see each statement on its own line. It makes it easier to spot errors.

44 is the ASCII for a comma. I wonder is the problem that the first value is invisible (maybe a 0) and what you see is the second character?

Try using Serial.println() for each value so you can see empty lines for empty values. Better still print each value with a "name" before it. For example

Serial.print("RED ");
Serial.println(r);
Serial.print("GREEN ");
Serial.print(g)
// etc

...R

the output can be seen in the attached image.

Thanks Robin2, I did the changes but the problem remains. The first number coming out (44) not related to readouts.

aureta:
Thanks Robin2, I did the changes but the problem remains. The first number coming out (44) not related to readouts.

Show us the output, please.

This is probably a good example of the value of surrounding data with start- and end-markers so that the receiving program knows when the real data starts and can ignore other stuff.

Have you a link to the documentation for the Adafruit library you are using ?

...R