Thanks
this give me this...
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
Serial.begin(38400);
Serial.println("Start color sensor");
// set the data rate for the NewSoftSerial port
mySerial.begin(38400);
mySerial.print('C');
}
void loop()
{
if (mySerial.available())
{
unsigned char c = mySerial.read(); // <------------ added unsigned char
Serial.print("<");
Serial.print(c, DEC);
Serial.print(">");
if (c == ',') Serial.println(); // split the R G and B
if (c == 13) Serial.println(); // extra newline
}
delay(1000);
}
I also added a delay just to see what I was getting from the sensor in one loop. the resulting data is somelike like:
<51>
10 seconds of running the serial monitor, i get something like:
b,Start color sensor
<49><56><44>
<177><147><148><152><156><134><49>