PICAXE and Arduino Interface with a MLX90614 IR Sensor

This program continually measures the temperature of the TO5 can package and the
temperature of the object emmitting the infrared energy. This is a matter of reading
RAM locations $06 and $07. Note that RAM locations are 16 bits wide.

The temperature in degrees Kelvin is then calculated as 0.02 * Val. Or TC_100 = 2 * Val - 27315.

Note that in subroutine ReadRAM, an 8-bit CRC consisting of all bytes sent and all byte received
is calculated. The result of the final step involving the received packet error correction (PEC)
byte should result in zero. If this is true, variable Status is set to a 1 to indicate the read was successful.

Timing is important with the SMBus and thus all CRC calculations are performed outside of the communication sequences.

This routine illustrates how to read from the 32 EEPROM locations. Of particular interest is
EEPROM location $04 (emissity) and $0e (assigned I2C slave address). Note that all EEPROM
locations are 16 bits and the emissivity does use all 16 (values 0 - 65535). However, the
slave address, in the range of 0 - 127 uses only the lower byte.