Software Serial Issues and Color Sensor

Hi,
I am trying to communicate with a DCSS501 RGB color sensor via a software serial comm protocol. The link to the sensors PDF is below:
http://www.sure-electronics.net/download/DC-SS501_Ver1.0_EN.pdf.

My code is:

// include the SoftwareSerial library so you can use its functions:
#include <SoftwareSerial.h>

#define rxPin 3
#define txPin 2

// set up a new serial port
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);

byte pinState = 0;

void setup() {
// define pin modes for tx, rx, led pins:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
// set the data rate for the SoftwareSerial port
Serial.begin(9600);
mySerial.begin(9600);
}

void loop() {

Serial.print("Red Value: ");
// print out the characters:
mySerial.print("$sure r");
mySerial.print(0x0d,HEX);
mySerial.print(0x0a,HEX);

// listen for new serial coming in:
char a = mySerial.read();
char b = mySerial.read();
char c = mySerial.read();
char d = mySerial.read();
char e = mySerial.read();
Serial.print(a);
Serial.print(b);
Serial.print(c);
Serial.print(d);
Serial.print(e,DEC);
Serial.println();

delay(1000);
}

No matter how I configure this all I seem to retrieve is blank data. Any ideas? Has anyone used this sensor before? Thanks,
Tom

Try this...

// include the SoftwareSerial library so you can use its functions:
#include <SoftwareSerial.h>

#define rxPin 3
#define txPin 2

// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

byte pinState = 0;

void setup()  {
  // define pin modes for tx, rx, led pins:
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  // set the data rate for the SoftwareSerial port
    Serial.begin(9600);
    mySerial.begin(9600);
}

void loop() { 
  
 Serial.print("Red Value: ");
  // print out the characters:
  mySerial.print("$sure r");
  mySerial.print(0x0d,HEX);
  mySerial.print(0x0a,HEX);
  
  // listen for new serial coming in:

  [glow]while ( mySerial.available() < 5 ) ; [/glow]

  char a = mySerial.read();
  char b = mySerial.read();
  char c = mySerial.read();
  char d = mySerial.read();
  char e = mySerial.read();
  Serial.print(a);
  Serial.print(b);
  Serial.print(c);
  Serial.print(d);
  Serial.print(e,DEC);
  Serial.println();
  
  delay(1000);
}

Does SoftwareSerial have an "available" method?

I have no idea. I'll leave it to the original poster to report back.

SoftwareSerial does not have an "available"... but the optional library, NewSoftSerial, no big deal to "install", just copy the folder from the zip to the folder with your other library folders, the ones that came as "standard".... DOES have an "available". Hurrah! Thank you NewSoftSerial authors!!