Thank you very much for all your help Tom. Without your assistance I would still be out in the dark. Getting more familiar with this CRC checking thing as I go. This is my final code to do the CRC check. I simply compare CRC to CRCCalc and look for the match.
Code:'--------- Calculate the CRC from Command Byte and Received Bytes -------------- GetSHTCRC: CRCCalc = 0 DataByte = SensorCmd gosub CalcSHTCRC DataByte = SensorData.byte1 gosub CalcSHTCRC databyte = SensorData.Byte0 gosub CalcSHTCRC CRC = CRC REV 8 return '--------------------- CRC Bit Calcuation Method ------------------------------- CalcSHTCRC: for i = 0 to 7 DataBit = CRCCcalc.7 ^ DataByte.7 DataByte = DataByte << 1 if DataBit = 0 then ShiftSHT CRCCcalc = CRCCcalc ^ $18 ShiftSHT: CRCCcalc = CRCCcalc << 1 CRCCcalc.0 = DataBit next i return




Bookmarks