I agree with what you are saying regarding the reading and peeking. I just ran a simple sketch to print the incoming bytes in decimal and hex to read what the camera is receiving.
void setup()
{
//digitalWrite(rx,LOW);
//digitalWrite(tx,LOW);
delay(3000);
Serial.begin(115200);
Serial.println("Initializing....");
cam.begin(115200);
delay(25);
cam.println("ET\r");
}
void loop()
{
while(cam.available() > 0)
{
byte temp = cam.read();
Serial.print(temp, HEX); Serial.print(" "); Serial.println(temp, DEC);
}
}
8A 138 << should read A not 8A
83 131<<should read 3 not 83
80 128 << color object 1
6C 108<< Upper left X
B8 184<< Upper left Y
87 135<<Lower Right X
4A 74<< Lower Right Y
80 128<<Color object 2
6C 108<<Upper leftX
FD 253<<Upper left Y
F8 248<<Lower Right X
5D 93<< Lower right Y
80 128
ED 237
5E 94
F8 248
B2 178
FF 255<< end of tracking packet
However the numbers being returned are not correct. The difference between upper left y and lower right y cannot be more than 17 pixels with the given camera firmware. And when tracking in the camera software, I return valid data. Do I need to declare the variable temp different? Or am I doing something else wrong?