#include <SoftwareSerial.h>
SoftwareSerial mySerial(10,11); // RX, TX
byte GetData[5]={0x80,0x04,0x00,0x7C};
void setup() {
// initialize serial:
Serial.begin(19200);
Serial.println("Co2");
mySerial.begin(19200);
mySerial.write(GetData,sizeof(GetData));
}
void loop()
{
if(mySerial.available())
Serial.println(mySerial.read());
}
the above code i have used to extract the data. now the problem is that as per the command i need to get only 5 bytes. I am getting frequently the same but in rare i am getting 4 and 7 bytes which i am suppose to discard.
I would really appreciate to you if u can provide some idea.
newdata.txt (51.4 KB)