what actually frame in io/o sampling?
in different site i am getting different pls help me out .
i am sensing LDR from remote xbee s2, here i attaching code pls help me out.
void setup() {
Serial.begin(9600);
}
;
void loop() {
// Remote XBee: AT, Base XBee: API
if (Serial.available() >= 23) { // Make sure the frame is all there
if (Serial.read() == 0x7E) { // 7E is the start byte
for (int i = 1; i<20; i++) { // Skip ahead to the analog data
byte discardByte = Serial.read();
}
int analogMSB = Serial.read(); // Read the first analog byte data
int analogLSB = Serial.read(); // Read the second byte
int analogReading = analogLSB + (analogMSB * 256);
Serial.print(analogReading);
}
Serial.println();
}
}